blob: d3df23eda9beeb9b379fb540941d3d93f7d18572 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
# 50 subshells whose body can change nothing outside, then one that has to
# fork. The counters tell the two apart: `cd` reads the shell's state, so
# it is not an output-only builtin and keeps its process. The last command
# is not a subshell, or the shell would become one and never print.
i=0
while [ $i -lt 50 ]; do
( true )
i=$((i + 1))
done
( echo a )
( cd /tmp || exit 1 )
echo done
|