On Tue, Jun 28, 2005 at 05:33:33PM +0300, guy keren wrote:
> 
> your while command probably runs in a sub-shell. note your use of a pipe
> (seq 10 | while).
> 
> the reason that you see the same PID, is because '$$' gets expanded before
> the fork that creates thw process with the 'while' command. so you see the
> PID of the while process's parent process.

As the expansion of $n has demonstrated, the expansion happens at the
subshell. The subshell expands $$ to "the PID of the main shell" rather
than to "my PID".

-- 
Tzafrir Cohen         | [EMAIL PROTECTED] | VIM is
http://tzafrir.org.il |                           | a Mutt's  
[EMAIL PROTECTED] |                           |  best
ICQ# 16849755         |                           | friend

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to