Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
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 chet@case.edu http://cnswww.cns.cwru.edu/~chet/