|
|
|
|
|
by rasguanabana
1814 days ago
|
|
Also, function body can be any compound command, so instead of braces {}, you can have parentheses (), which causes each function call to spawn a subshell. Very useful if your function needs isolated state or you change working directory and don’t want to affect global state. You can have exit command in such function, because it terminates the subshell only, not the whole script. for, while and until are also compound commands, so they also can be used as function body directly without braces, but there’s no practical use for that, really. |
|