You can write your own functions in the Bourne and Korn shells and use them as part of other scripts.
Not all Bourne shells support functions. However, the Solaris Bourne shell does support functions.
User-defined functions are useful if you have a series of commands that you want to use repeatedly. The functions written for an application server are an example of user-defined functions. Some examples of functions are provided in “Example Scripts”. When you define a function, you use the name of the function at the place where you want to execute the series of commands contained in the function.
Typically, you define functions at the beginning of a script, but you can define them in separate files and share them between ...