Re: Monitor mode handling (bug ?)

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

 



On Wednesday, January 18, 2023 12:40:12 PM CET Ganael Laplanche wrote:

Hello again,

Oops, my previous example was missing the final ampersand.

For the recall, here is what actually works (on FreeBSD, including the set +m 
fix):

$ cat ./test.sh
#!/usr/local/bin/dash
/usr/local/bin/dash -c '
    set -m
    (
      sleep 1
    ) &
    i=$!
    set +m
    echo >&2 "inner Main shell has: $(ps -o pid,pgid $$)"
    echo >&2 "inner Sub-shell has: $(ps -o pid,pgid $i)"
    wait $i
' &
echo "outer Main shell has: $(ps -o pid,pgid $$)"

$ ./test.sh
outer Main shell has:   PID  PGID
47919 47919
inner Main shell has:   PID  PGID                                                                                                                                                                                  
47920 47919
inner Sub-shell has:   PID  PGID
47922 47922

Cheers,

-- 
Ganael LAPLANCHE <ganael.laplanche@xxxxxxxxxxxx>
http://www.martymac.org | http://contribs.martymac.org
FreeBSD: martymac <martymac@xxxxxxxxxxx>, http://www.FreeBSD.org





[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux