Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.shell Subject: Re: How do you pipe after a here document Message-ID: <2431@sixhub.UUCP> Date: 28 Nov 90 03:12:25 GMT References: <1990Nov8.201508.13222@cid.aes.doe.CA> <27620006@hp-lsd.COS.HP.COM> <1F37P47@xds13.ferranti.com> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 37 In article <1F37P47@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes: | OK, so how do you pipe that here document through: | | while read foo bar baz | do | case $baz in | coconuts) echo $foo $bar THEM;; | *) su root -c 'rm -f /etc';; | esac | done | | (nope, stranger, it's "this here document") You can put the grep before the loop (and you don't need the cat): grep cocoanuts <