1 |
On 02/03/2013 01:12 AM, Ulrich Mueller wrote: |
2 |
>>>>>> On Sun, 3 Feb 2013, Ryan Hill wrote: |
3 |
> |
4 |
>> We have eclasses that require Bash 4 (eg. multiprocessing.eclass |
5 |
>> uses BASHPID). |
6 |
> |
7 |
> I wonder why it would be needed there. Doesn't $$ work? |
8 |
|
9 |
In a subshell, I think $$ is the pid of the parent shell, while BASHPID |
10 |
is the real pid of the current subshell. Test cases: |
11 |
|
12 |
$ echo $$ |
13 |
24996 |
14 |
$ ( echo $$ ) |
15 |
24996 |
16 |
$ echo ${BASHPID} |
17 |
24996 |
18 |
$ ( echo ${BASHPID} ) |
19 |
25006 |
20 |
|
21 |
However, multiprocessing.eclass does not appear to do anything with the |
22 |
pid anyway. Inside multijob_finish_one it reads the pid from the pipe |
23 |
and does nothing with it. |
24 |
-- |
25 |
Thanks, |
26 |
Zac |