I\'d like to return an exit code from a BASH script that is called within another script, but could also be called directly. It roughly looks like this:
#!/b
Use this instead of exit or return:
[ $PS1 ] && return || exit;
Works whether sourced or not.