How do you return to a sourced bash script?
问题 I use a script that extends using the bash source feature; #!/bin/bash source someneatscriptthatendsprematurely.sh I would like to be able to return from that script, without breaking the main script. Using exit breaks the main script, return is only valid in functions and experimenting with $(exit 1) does not seem to work either. So, is it possible to return in a sub-bash script without breaking the main bash? Any help appreciated! 回答1: You need the return statement: return [n] Causes a