bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: in spawned processes, both $$ and $PPID are wrong


From: Chet Ramey
Subject: Re: in spawned processes, both $$ and $PPID are wrong
Date: Tue, 10 Apr 2007 11:37:26 -0400

> Bash does not represent current pid and parent process-id correctly
> in spawned processes.

It does; the situations you include in your message represent what
Posix calls a "subshell environment", and $$ does not change in those
cases.  Both $$ and $PPID is set when a shell initializes.  When a
subshell is created as a copy of the parent, $$ and $PPID are part of
the copied environment. 

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                                Live Strong.
Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.case.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]