RE: Possible bug with BASH V4: The $!

2013-04-12 Thread Lenga, Yair
, April 11, 2013 2:03 PM To: Lenga, Yair [ICG-MKTS] Cc: 'chet.ra...@case.edu'; 'Dan Douglas'; 'bug-bash@gnu.org' Subject: Re: Possible bug with BASH V4: The $! On 4/11/13 12:15 PM, Lenga, Yair wrote: Dan, Chet: Many thanks for the info about BASHPID. I've checked BASHPID on RH6, and it looks

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Greg Wooledge
On Thu, Apr 11, 2013 at 01:05:43PM +, Lenga, Yair wrote: Is it possible to add back the functionality to allow the child process to somehow retrieve it's OWN PID. You are looking for the BASHPID variable, which expands to the process ID of the current bash process (even in a subshell).

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Dan Douglas
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

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Chet Ramey
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

RE: Possible bug with BASH V4: The $!

2013-04-11 Thread Lenga, Yair
Ramey [mailto:chet.ra...@case.edu] Sent: Thursday, April 11, 2013 10:14 AM To: Lenga, Yair [ICG-MKTS] Cc: Dan Douglas; bug-bash@gnu.org; chet.ra...@case.edu Subject: Re: Possible bug with BASH V4: The $! On 4/11/13 9:24 AM, Dan Douglas wrote: On Thursday, April 11, 2013 01:05:43 PM Lenga, Yair

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Greg Wooledge
On Thu, Apr 11, 2013 at 04:15:45PM +, Lenga, Yair wrote: + The man page list BASH_VERSION, etc., but no indication of BASHPID. It's probably a good idea to put a note next to '$!' about BASHPID. It is certainly in the man page: BASHPID Expands to the process ID of the

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Dan Douglas
On Thursday, April 11, 2013 04:15:45 PM Lenga, Yair wrote: ( echo $!) ( echo $!) According to POSIX, both calls should print (nothing). As the background command does not come from the current shell. With BASH4, The first call will print (nothing), second call will print the PID of

Re: Possible bug with BASH V4: The $!

2013-04-11 Thread Chet Ramey
On 4/11/13 12:15 PM, Lenga, Yair wrote: Dan, Chet: Many thanks for the info about BASHPID. I've checked BASHPID on RH6, and it looks OK. Few comments related to making the change visible, and POSIX compliance. + The 'set' command, does not print the BASHPID, this make it very hard to