Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


Top White Papers

More on LinuxToday


Learn To Use Functions

Mar 30, 2010, 12:33 (0 Talkback[s])

[ Thanks to Andrew Weber for this link. ]

"Functions

"A function can help you modularize your script. In addition, the function is executed in the context of the same shell, no child process. This will save on resources as you use functions. Functions are a script within a script which can be defined by the user and stored in memory, allowing you to reuse the function repeatedly. This also provides a modular aspect that allows you to debug one function at a time be disabling functions.

"Think of functions as miniature shell scripts, or containers inside a shell script where each container functions within itself to provide resources for the larger script. One big difference between a shell script and a function is that a new instance of the shell is started for a shell script but the function runs in the current shell"

Complete Story

Related Stories: