December 1999
Beginner
528 pages
11h 10m
English
Parameters are passed to function just like in a normal script using the special variables $1, $2... $9. When the function gets arguments passed to it, it will replace the arguments originally passed to the shell script, if any, so it’s always a good idea to reassign the variables when the function gets them. This is a good idea anyway; if there are any bugs in the function, they can quickly be tracked down by the localized variable names. The convention for calling arguments (variables) inside a function is to start each variable name with a underscore (_), like this: _FILENAME or _filename.
Read now
Unlock full access