December 1999
Beginner
528 pages
11h 10m
English
Here is a simple function:
hello () {echo "Hello there today’s date is `date`" }
All functions have to be declared before you use them. What this means is that you must put all your functions at the top of the script. You cannot reference a function until the shell interpreter has seen it first. To call a function you simply call it by its name. In the above example, the function name is ‘hello’; the function’s body contains a echo statement containing today’s date.
Read now
Unlock full access