I have written some shell scripts and found that creating a template can be handy. So I created this template. So most
of the time I start with this template. This template provides
* basic flags that most shell script use. [see usage below]
* getopts structure is in place
* A default logger
* Almost ready to use usage function.
Below is what you see if you run this script as is. Now you can only concentrate on your main function to do what you
need to do.
usage: $myname [options]
-h optional Print this help message
-q optional Suppress log messages on screen, just log them.
-f optional Force
-irequired input file
-loptional print errors and output to this file.
default ${myname}.log
-ooptional store output here.
default is"
The shell script code is here.
Friday, October 23, 2009
Bash Template Shell Script
Subscribe to:
Posts (Atom)