[Top][All Lists]

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

Re: Possible bug with BASH V4: The "$!"

From: Chet Ramey
Subject: Re: Possible bug with BASH V4: The "$!"
Date: Thu, 11 Apr 2013 10:13:51 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130307 Thunderbird/17.0.4

On 4/11/13 9:24 AM, Dan Douglas wrote:
> On Thursday, April 11, 2013 01:05:43 PM Lenga, Yair wrote:
>> With BASH 3.0, the backgrounded task could access the PID of the parent using
>> "$$", and the PID Of itself as "$!".
>> With BASH 4.0, the script fail, the "$!" is not available to the child
>> process.
>> Is it possible to add back the functionality to allow the child process to
>> somehow retrieve it's OWN PID.  I assume that the behavior of  "$$" cannot be
>> modified at this time.
> BASHPID was introduced in Bash 4. I would guess that prior to that, the
> behavior of $! was either a nonstandard extension or unintentional bug. Check
> the changelog.

According to the change log, I made this change in late November 2006 as
the result of a shell discussion on the austin-group list.  BASHPID came
in to replace it shortly after.

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

reply via email to

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