Colin Log

configuring computers, preventing cerebral data-loss

« Back to posts
  • Viewed
    times
June 29, 2010

Bash Scripting with Arguments (getopt and getopts)

  • Edit
  • Delete
  • Tags
  • Autopost

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