First page Back Continue Last page Graphics
bash Functions
A function does not need to return a result, but it may do so in 3 ways (perhaps all in the same function):
- set a new value into a variable previously defined outside the function;
- Use a return statement to set the value of $?; it can also use an exit to set $?, but that will also exit from the calling script which may not be what you want.
- write the results to stdout.