PDA

View Full Version : Bash-scripting options



SakJur
March 7th, 2009, 05:20 PM
In a script named coconut.sh I've made I want to be able to use flags á la --help, --version, --quiet and --url=http://canonical.com etc.

This flags are btw. going to link to variables :D
How do I do this?

Thanks for any reply
Your Sincerly
Emil

the_unforgiven
March 7th, 2009, 05:26 PM
You use getopt (http://linux.die.net/man/1/getopt).
Here is how you use it:
http://www.linuxlaboratory.org/?q=node/4

HTH ;)