[Gllug] Bourne shell programming

Progga progga at BengaLinux.Org
Sun Nov 19 11:27:59 UTC 2006


On Sun, Nov 19, 2006 at 03:24:07AM +0000, Mike Brodbelt wrote:

> How can I replace stdin with the output of my previous command? I need
> to be able to read from the pipeline....

grep root /etc/passwd | awk -F: '{print $1,$2,$3}' > tmp.txt

exec 3< tmp.txt

while read x <&3
do
	some stuff
done

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20061119/41a6bd04/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list