forked before bash subshell

2016-10-11 Thread s7v7nislands
1. the script to reproduce bash-4.4$ cat t.sh (cd /tmp && sleep 20) & echo "end" 2. run it bash-4.4$ bash t.sh end 3. script end, but there is a new forked script. bash-4.4$ ps -ef | grep t.sh 501 50268 1 0 10:09AM ttys0150:00.00 bash t.sh 501 50275 50181 0 10:10AM ttys015

Re: wait and procsubs

2016-10-11 Thread Chet Ramey
On 10/11/16 1:50 AM, isabella parakiss wrote: > wait doesn't wait for procsubs unless it's passed the pid as an argument > > $ time { : <(sleep 1); wait; } > real: 0m0.002s, user: 0m0.000s, sys: 0m0.003s > $ time { : <(sleep 1); wait $!; } > real: 0m1.011s, user: 0m0.003s, sys: 0m0.007s > > is th