mirror of https://github.com/Idnan/bash-guide.git
Fix function declaration syntax (#59)
This commit is contained in:
parent
8d38caf0fa
commit
b90e8b56c7
|
@ -998,7 +998,7 @@ ${#varname} # returns the length of the value of the variable as a character
|
||||||
As in almost any programming language, you can use functions to group pieces of code in a more logical way or practice the divine art of recursion. Declaring a function is just a matter of writing function my_func { my_code }. Calling a function is just like calling another program, you just write its name.
|
As in almost any programming language, you can use functions to group pieces of code in a more logical way or practice the divine art of recursion. Declaring a function is just a matter of writing function my_func { my_code }. Calling a function is just like calling another program, you just write its name.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
functname() {
|
function name() {
|
||||||
shell commands
|
shell commands
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue