On Mon, Jul 04, 2005 at 02:53:01PM +0100, Jim Hague wrote:
> Package: bash
> Version: 3.0-15
> Severity: normal
> 
> $ echo Hello, world | read a b; echo $a $b
> 
> doesn't produce the expected 'Hello, world' output, but just a blank
> line.
> 
> I'm no bash expert, but this doesn't seem right.  FWIW, zsh(Debian) and
> ksh(AIX) produce the expected output.
I believe the reason is this (from sh(1)):

       Each command in a pipeline is executed as a separate process
       (i.e.,  in a subshell).

       ...

       A  command  invoked  in  this  separate  environment  cannot
       affect the shell's execution environment.

It will work if you use read <<EOF ...

Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to