mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-29 23:24:55 +02:00
13 lines
341 B
Markdown
13 lines
341 B
Markdown
![]() |
# 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}}; }`
|