commands.sh

return

all

Exit a function. Can exit out of a script if run with `source`. See also: `exit`.

More info →

Examples (2)

Exit a function prematurely

func_name() { echo "This is reached"; return; echo "This is not"; }

Specify the function's return value

func_name() { return exit_code; }
made by @shridhargupta | data from tldr-pages