mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 09:02:08 +02:00
return: add page (#15244)
This commit is contained in:
parent
352ee6de86
commit
3efaf60d50
1 changed files with 12 additions and 0 deletions
12
pages/common/return.md
Normal file
12
pages/common/return.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# return
|
||||||
|
|
||||||
|
> Exit a function or a script if run with `source`.
|
||||||
|
> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-return>.
|
||||||
|
|
||||||
|
- 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}}; }`
|
Loading…
Add table
Reference in a new issue