On 4/30/14, 4:34 PM, Viktor Szépe wrote:
> echo first $$ >&2 | bash -c 'echo second $$'
> first 30551
> second 28057
> 
> but 
> 
> eval 'echo first $$' >&2 | eval 'echo second $$'
> first 30551
> second 30551

$$ doesn't change in a subshell environment.  It changes in your first
example because you're starting a new shell instance.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to