Sujet : Re: Using << and an output pipe together in shell (bash)
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.unix.shellDate : 31. Oct 2024, 23:37:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87r07v99wd.fsf@bsb.me.uk>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
gazelle@shell.xmission.com (Kenny McCormack) writes:
Consider this code in a bash script:
>
(Note: No actual indentation is intended - only shown like this for posting)
>
someCommand ... << EOF | someOtherCommand
some data
for someCommand
EOF
>
This should work, right?
>
In simple cases, it does (seem to) work OK.
>
However, in the actual real world case, it is more like:
>
someCommand -x -y "sjdfhk" and more options \
-g and still more options -Q "another option" << EOF |
I think you need "| \" at the end of this line. At least that's what I
usually do and it seems to work.
/usr/lib/ANotherCommand -x "with option" and "more options"
some data
for someCommand
EOF
-- Ben.