# 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