I'd like to use the read command for initialize a variable with a value which comes from the output of a previous command. I would expect that this works:
echo some_text | read VAR
But $VAR is empty. "read reads a single line from standard input." says the manpage. The pipeline sends the output of echo to the input of read. Where am I wrong?
My working solution is
echo text > file ; read VAR < file
But it uses a file...