200 |
variable names. Don't use `return', instead echo the result of a |
variable names. Don't use `return', instead echo the result of a |
201 |
function and call it from within backquotes. |
function and call it from within backquotes. |
202 |
|
|
203 |
* Function names should be prefixed `func_'. |
* Function names should be prefixed `func_', the function header should |
204 |
|
look like this: |
205 |
|
|
206 |
|
# func_foo [ OPTIONS ] |
207 |
|
# Description of what func_foo does and returns. |
208 |
|
func_foo () |
209 |
|
{ |
210 |
|
$opt_debug |
211 |
|
# contents of func_foo ... |
212 |
|
} |
213 |
|
|
214 |
|
The `$opt_debug' is used to enable shell tracing (Korn shells reset |
215 |
|
this on function entry). |
216 |
|
|
217 |
* For functions that are called frequently, if you need to return a |
* For functions that are called frequently, if you need to return a |
218 |
value, don't cause unneccessary forking of the shell using echo as |
value, don't cause unneccessary forking of the shell using echo as |