bash functions: enclosing the body in braces vs. parentheses
Usually, bash functions are defined using curly braces to enclose the body: foo() { ... } When working on a shell script today making extensive use of functions, I've run into problems with variables that have the same name in the called as in the calling function, namely that those variables are the same. I've then found out that this can be prevented by defining the local variables inside the function as local: local var=xyz . Then, at some point, I've discovered a thread ( Defining bash function body using parenthesis instead of braces ) in which it is explained that it's just as valid to