On 12/30/16 11:07 PM, Grisha Levit wrote:
> On Fri, Dec 30, 2016 at 11:03 PM, PePa <peterke...@passchier.net
> <mailto:peterke...@passchier.net>> 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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to