Script help

David Eduardo Gómez Noguera tsukebumi at gmail.com
Mon Oct 9 12:51:49 UTC 2006


On Mon, 2006-10-09 at 13:12 +0100, Dave Mitchell wrote:
> On Mon, Oct 09, 2006 at 12:43:22PM +0100, Dan Track wrote:
> > have a script that does the following:
> > 
> > cat /tmp/file | while read rpm
> > 
> > what I would like to do is to remove the "|" pipe command but keep the
> > "while read rpm" part while also somehow cat the contents of the file
> > into the "while read rpm" line, how can I do that?
> 
>     (
> 	while read rpm; do
> 	    ...
> 	done
>     ) < /tmp/file
> 
That would still fork a bash process.
Here is an example how to do it without forking

http://en.wikipedia.org/wiki/Bash#I.2FO_redirection

> -- 
> Fire extinguisher (n) a device for holding open fire doors.
> 




More information about the users mailing list