1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-03 17:15:32 +02:00
tldr/pages/common/function.md
2025-07-20 21:53:38 +05:30

20 lines
429 B
Markdown

# function
> Define a function.
> More information: <https://www.gnu.org/software/bash/manual/bash.html#Shell-Functions>.
- Define a function with the specified name:
`function {{func_name}} { {{echo "Function contents here"}}; }`
- Run a function named `func_name`:
`func_name`
- Define a function without the `function` keyword:
`{{func_name}}() { {{echo "Function contents here"}}; }`
- Display help:
`help function`