How do you pipe after a here document

Shiping Zhang ping at cubmol.bio.columbia.edu
Fri Nov 9 09:08:29 AEST 1990


In article <1990Nov8.201508.13222 at cid.aes.doe.CA> afsipmh at cidsv01.cid.aes.doe.CA () writes:
 
> I want to do something like the following:
 
>#! /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?

Try the following:

#! /bin/sh
cat <<END | grep coconuts
I,ve got
a lovely
bunch of coconuts
END 

-ping



More information about the Comp.unix.shell mailing list