Bash Scripting with Arguments (getopt and getopts)
Great rundown of getopt and getopts
http://aplawrence.com/Unix/getopts.html
Examples of getopts usage:
http://tldp.org/LDP/abs/html/internal.html#EX33
And a really good example script using bash getopt long options:
http://techpatterns.com/forums/about1138.html
Really good guide to BASH parameter expansion
http://mywiki.wooledge.org/BashFAQ/073
http://mywiki.wooledge.org/BashFAQ/073