How do you pipe after a here document

D'Arcy J.M. Cain darcy at druid.uucp
Sat Nov 10 23:46:24 AEST 1990


In article <1990Nov8.201508.13222 at cid.aes.doe.CA> afsipmh at cidsv01.cid.aes.doe.CA () writes:
>
>#! /bin/sh
>cat <<END
>I,ve got
>a lovely
>bunch of coconuts
>END 
>| grep coconuts
>
>The above doesn't work so how can I do it?

Well the last line has no connection to the rest of the script so I am not
suprised.  I assume you tried putting it on the same line as "END" and saw
that there was no effect either.  The answer is to put it on the "cat" line
like this:

cat | grep coconuts << END

-- 
D'Arcy J.M. Cain (darcy at druid)     |
D'Arcy Cain Consulting             |   I support gun control.
West Hill, Ontario, Canada         |   Let's start with the government!
+ 416 281 6094                     |



More information about the Comp.unix.shell mailing list