This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Piping to the 'read' command


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? 


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]