Mark Allums wrote:
As others pointed out, the variable a that is read is in another shell. If you want to do something like this, you need to turn it around:On 1/4/2010 1:10 PM, Foss User wrote:I see that the read command stores input entered only on the console into the variables. Example: $ read a foo $ echo $a foo But when I don't enter input on the console by keyboard, but pipe it into the standard input of read, I am unable to store the input into the variable. $ echo bar | read a $ echo $a foo
a=$(echo bar) Eric