Re: Piping to the 'read' command

2006-10-29 Thread Jim Easton
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 $

Re: Piping to the 'read' command

2006-10-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to [EMAIL PROTECTED] on 10/27/2006 6:38 AM: > Thanks Dave - I guess I should have explained in my original email that > I'm converting a ksh script which currently runs successfully under > HP-UX. If I run the following command under HP-UX ks

RE: Piping to the 'read' command

2006-10-27 Thread cwmail
environment. This doesn't happen under Cygwin pdksh, and I don't understand why. Regards Ian - Original message - From: "Dave Korn" To: cygwin Date: Fri, 27 Oct 2006 11:32:06 +0100 Subject: RE: Piping to the 'read' command On 27 October 2006 04:04, [EMAIL PR

Re: Piping to the 'read' command

2006-10-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Jim Easton on 10/27/2006 1:43 AM: > Hi, > > Fri, 27 Oct 2006 Ian Taylor wrote: >> Can anyone explain what is happening here (using pdksh as my shell) when >> I try to set an environment variable using 'read': This is one of the bash FAQs

RE: Piping to the 'read' command

2006-10-27 Thread Dave Korn
On 27 October 2006 04:04, [EMAIL PROTECTED] wrote: > Can anyone explain what is happening here (using pdksh as my shell) when > I try to set an environment variable using 'read': Variables set in a subshell process are not returned back into the parent process environment. > > This works: >

Re: Piping to the 'read' command

2006-10-27 Thread Jim Easton
Hi, Fri, 27 Oct 2006 Ian Taylor wrote: > Can anyone explain what is happening here (using pdksh as my shell) when > I try to set an environment variable using 'read': ... > > This doesn't work: > $ echo Test2 | read VAR2 > $ echo "VAR2 is $VAR2" > VAR2 is > > This works within the 'while' loop o

Piping to the 'read' command

2006-10-26 Thread cwmail
Can anyone explain what is happening here (using pdksh as my shell) when I try to set an environment variable using 'read': This works: $ read VAR1 Test1 $ echo "VAR1 is $VAR1" VAR1 is Test1 This doesn't work: $ echo Test2 | read VAR2 $ echo "VAR2 is $VAR2" VAR2 is This works within the 'while'