Piping to the 'read' command

Jim Easton jim@cs.ualberta.ca
Sun Oct 29 11:10:00 GMT 2006


Hi,

Fri, 27 Oct 2006 Eric Blake wrote:
> According to Jim Easton on 10/27/2006 1:43 AM:
> > This suggests to me that it is executing that read in a subshell that
> > can't pass the variable back to its parent.  This dispite the fact that
> > it appears to be the same process.  (see inserted echo $$)
> 
> Sorry, but POSIX requires $$ to be the same in subshells as it is in the
> parent, even though that means that in subshells, it is not the parent
> process id, but the grandparent.  There is no way, using $$, to tell
> subshells apart from the original.

Well isn't that interesting - I never noticed that before.
Obviously I've never needed to.

However, I don't think that has always been the case, as I recall,
when I first encountered Bourne shells, back in 1984, you could.  I
got into the habit of assuming it would be different.  For example; I
would define a temp file as TMP=tmp$$ in the parent and export it.

I wonder why?  Anyone know? 

	Jim

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list