Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!henry
From: henry@utzoo.UUCP (Henry Spencer)
Newsgroups: net.unix
Subject: Re: why doesn't this shell program work
Message-ID: <5150@utzoo.UUCP>
Date: Sun, 3-Mar-85 00:26:30 EST
Article-I.D.: utzoo.5150
Posted: Sun Mar  3 00:26:30 1985
Date-Received: Sun, 3-Mar-85 00:26:30 EST
References: <2147@drutx.UUCP>
Organization: U of Toronto Zoology
Lines: 8

The pipe is causing the main shell to spin off a child shell to run
the innards of the for-loop.  The result is that the variable
is local to the child, and naturally doesn't propagate back into the
parent since there is no path by which it might do so.  You have just
encountered Excedrin Headache number 3.14159 for shell programmers.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry