bug-bash
[Top][All Lists]
Advanced

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

Re: Process group id of first command in command substitution (bash4 vs


From: Chet Ramey
Subject: Re: Process group id of first command in command substitution (bash4 vs bash3)
Date: Sat, 10 Mar 2012 15:30:47 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 2/20/12 1:25 PM, Roman Rakus wrote:
> I'm not sure if it's a bug or not, but there is change between old bash 3.2
> and bash 4.2.
> When you run a script:
> set -m
> $(sleep 1; sleep 2)
> 
> in bash 4.2 the first sleep has same group id as parent shell. However in
> bash 3.2 it has different group id.
> 
> Is it bug or not? I'm not able to find documentation for this change. And
> seems that POSIX says nothing about it.

The intent of the bash code has always been that the process group of
commands running command substitutions be the same as the parent shell.
That way they can get the same signals.  I read Posix as supporting this
interpretation, since the -m option applies to jobs and command
substitutions are not jobs.

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



reply via email to

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