Can anyone explain this behavior? Running:
echo "hello world" | read var1 var2
results in nothing being ouput, while:
echo "hello world" > test.file
read var1 var2 < test.file
produces the expected output:
Shouldn't the pipe do in one step what the redirection to test.file did in the second example? I tried the same code with both the dash and bash shells and got the same behavior from both of them.