New to linux
I would like know when it is necessary or advisable to write a shell script instead of shell function ?
|
Shell scripts
Are you using bash?
If so what is it that you mean? |
Quote:
|
Strictly speaking, these are not distinct, since shell functions use the same scripting language as a script. Functions are handy when you want to re-use code, such as when you have a library of generic functions that you source in numerous other scripts. The system startup and configuration scripts for many distros use this technique.
Functions can be loaded and remain in the environment in your shell, ready for use when needed. I have a few of these that I load in my .bashrc file. One nice thing is that they are found by readline when I use the tab key for commandline completion. --- rod. |
All times are GMT -5. The time now is 10:01 PM. |