[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (feature request) here-document, but from a file
From: |
William Park |
Subject: |
Re: (feature request) here-document, but from a file |
Date: |
Sun, 3 Jul 2005 21:39:03 -0400 |
User-agent: |
Mutt/1.4.2i |
On Sat, Jul 02, 2005 at 11:43:36PM -0400, Chet Ramey wrote:
> Chris F.A. Johnson wrote:
> > On Sat, 2 Jul 2005, William Park wrote:
> >
> >> Dear Chet,
> >>
> >> It would be nice if I can read a file and process it as though it was
> >> here-document text in the script. Mainly, I want variable substitution,
> >> without calling lots of 'sed'.
> >>
> >> In Python, you would do
> >> print "..." % ...
> >>
> >> So, perhaps, you can use syntax like
> >> cat <<+ file
> >> cat <<<< file
> >
> >
> > Why can't you use:
> >
> > cat < file
>
> Because he wants variable substitution. Something like
>
> cat <<< "$(< file)"
>
> might work.
Darn it, it does work. Argghh... I already included a here-file patch
with my latest release:
http://home.eol.ca/~parkw/index.html#herefile
http://home.eol.ca/~parkw/index.html#here_file
Usage:
cat <<<< file
herefile < file
herefile file
Hi Chet. Off topic... I'm currently considering adding GTK+ interface
to Bash, so that you can do basic "dialog" stuff in Bash directly. But,
if it's only dialog stuff, then there isn't much point, because you can
just use real 'dialog' or 'Xdialog'.
Have you come across any project that tries to add GUI features to any
shell?
--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/