mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-12 15:59:05 +00:00
Update cheatsheets
This commit is contained in:
17
tldr/return
Normal file
17
tldr/return
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# 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}}; }`
|
||||
Reference in New Issue
Block a user