How do you pipe after a here document
Neil Rickert
rickert at mp.cs.niu.edu
Fri Nov 9 10:33:50 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?
How about:
grep coconuts <<END
I,ve got
a lovely
bunch of coconuts
END
or even:
( cat <<END
I,ve got
a lovely
bunch of coconuts
END
) | grep coconuts
--
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Neil W. Rickert, Computer Science <rickert at cs.niu.edu>
Northern Illinois Univ.
DeKalb, IL 60115. +1-815-753-6940
More information about the Comp.unix.shell
mailing list