bug-bash
[Top][All Lists]
Advanced

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

forked before bash subshell


From: s7v7nislands
Subject: forked before bash subshell
Date: Tue, 11 Oct 2016 19:14:24 -0700 (PDT)
User-agent: G2/1.0

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 ttys015    0:00.00 bash t.sh
  501 50275 50181   0 10:10AM ttys015    0:00.00 grep t.sh



question:
when using sh -> dash, It will not fork before subshell, what's the different?

why bash bahavior like this? is that a bug?

if not, why should forked before execute subshell?

thanks!


reply via email to

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