bash and mksh cannot set a variable from a pipe
Issue
- bash fails to set a variable when reading from a pipe:
[user@localhost ~]$ echo foo | read bar [user@localhost ~]$ echo "bar=\"$bar\"" bar="" [user@localhost ~]$
- mksh also fails the same way
Environment
- Red Hat Enterprise Linux, any version
- bash, any version
- mksh, any version
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.