On 12/30/16 11:07 PM, Grisha Levit wrote:
> On Fri, Dec 30, 2016 at 11:03 PM, PePa <[email protected]
> <mailto:[email protected]>> wrote:
>
> r=23; echo $r; echo -e "r=bc\necho $r" |bash
>
> You need to escape the |$| in the second echo statement so that |$r| is not
> evaluated to |23| before being echoed.
The easiest way to see what bash gets on its standard input is to replace
`bash' in the pipeline with `cat'.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/