vault backup: 2024-05-30 18:34:46
This commit is contained in:
parent
411a900089
commit
08046ad2f2
@ -119,13 +119,16 @@ To execute a function, simply include the name of the function. To execute the a
|
|||||||
function_name
|
function_name
|
||||||
```
|
```
|
||||||
|
|
||||||
To declare a local variable in a function, prefix the declaration with the `local` keyword.
|
By default, all variables in bash are global. To declare a local variable in a function, prefix the declaration with the `local` keyword.
|
||||||
```bash
|
```bash
|
||||||
function_name () {
|
function_name () {
|
||||||
|
local A='A'
|
||||||
|
echo `A`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To return a value from a function, use the `retu`
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
Loading…
Reference in New Issue
Block a user