How do you pipe after a here document

Peter da Silva peter at ficc.ferranti.com
Wed Nov 21 10:52:44 AEST 1990


In article <27620006 at hp-lsd.COS.HP.COM> jimr at hp-lsd.COS.HP.COM (Jim Rogers) writes:
> The following works for me:
> 
> #! /bin/sh
> cat <<END | grep coconuts
> I,ve got
> a lovely
> bunch of coconuts
> END 

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")
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter at ferranti.com 



More information about the Comp.unix.shell mailing list