On Sat, Jan 20, 2001 at 11:24:22AM -0800, John H Darrah wrote:
> On Thu, 18 Jan 2001, Hal Burgiss wrote:
> 
> num=0
> echo 1 > tmp
> 
> while read line
> do
>     num=1
>     echo $num
> done < tmp
> 
> echo $num
> 
> The above will accomplish the same thing by redirecting
> stdin from "tmp" for the "while" loop, preventing a fork. 

Neat. Mucho better. Thanks.
 
> Remember that a "|" will always cause a subprocess to be
> forked

ACK.

-- 
Hal B
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
--



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to