X-Spam-Check-By: sourceware.org Subject: Re: Piping to the 'read' command In-Reply-To: From Eric Blake at "Oct 27, 2006 06:03:37 am" To: cygwin AT cygwin DOT com Date: Sun, 29 Oct 2006 01:22:39 -0700 (MST) CC: Jim Easton X-Mailer: ELM [version 2.4ME+ PL66 (25)] Message-Id: <20061029082239.A30225663C@erskine.cs.ualberta.ca> From: jim AT cs DOT ualberta DOT ca (Jim Easton) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/