10
Executing the exit in a subshell is one pitfall. Even more puzzling is thwarting the effect of exit by wrapping it into local builtin like in the following script #!/bin/bash function calc { echo 42; exit 1; } echo $(calc) The script prints 42. Here, the exit does not abort the sc...