[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (feature request) here-document, but from a file
From: |
Chet Ramey |
Subject: |
Re: (feature request) here-document, but from a file |
Date: |
Sat, 02 Jul 2005 23:43:36 -0400 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Macintosh/20050317) |
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.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/