RE: Piping to the 'read' command

2006-10-27 Thread cwmail
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 ksh: echo "Test" | read VAR1 VAR1 will hold the value "Test" in the parent environment. This doesn't happ

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'