I'm trying to pipe some data from a Bash pipe into a Bash variable using the read command, like this:
$ echo "Alexander the Grape" | read quot $ echo $quot $
But quot is empty. Some Googling revealed that this is not a bug; it's an intended feature of Bash. (Section E5 in the FAQ.)
But when I tried the same thing in zsh, it worked. (Ditto for ksh.) Is there any way to make this work in Bash? I really don't want to have to type:
$ quot=$(echo "Alexander the Grape")
Especially for long commands.