Stack a shell, see both, and come back out
Stack a shell, see both, and come back out
Answer
echo $SHELL ps -o pid,comm sh ps -o pid,comm exit
The second `ps` shows one more shell than the first: running a shell by name adds a child process, it does not replace the one you were in. `exit` (or Ctrl-D on an empty line) pops exactly one level.
Sarwar & Koretsky 3e ch2 §2.7–2.8