From 3efaf60d50f67f9e4f6193c6579a1120bd47ab32 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:21:30 +0200 Subject: [PATCH] return: add page (#15244) --- pages/common/return.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pages/common/return.md 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}}; }`