diff --git a/pages/common/return.md b/pages/common/return.md new file mode 100644 index 000000000..6f65af227 --- /dev/null +++ b/pages/common/return.md @@ -0,0 +1,12 @@ +# return + +> Exit a function or a script if run with `source`. +> More information: . + +- Exit a function prematurely: + +`{{func_name}}() { {{echo "This is reached"}}; return; {{echo "This is not"}}; }` + +- Specify the function's return value: + +`{{func_name}}() { return {{N}}; }`