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. Chet -- ``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/