Bash Getopts - Scripts with Command Line OptionsMay 23, 2014, 09:00 (0 Talkback[s])
(Other stories by Linerd)
WEBINAR: On-demand Event
Replace Oracle with the NoSQL Engagement Database: Why and how leading companies are making the switch REGISTER >
I've always wanted to know how to create command line options for my Bash scripts. After some research I found there are two functions available to handle this; getopt and getopts. I'm not going to get into the debate about which one is better. getopts is a shell builtin and seems a little easier to implement than getopt, so I'll go with that for now. This tutorial provides example code to process command line switches or options in bash scripts using getopts.
0 Talkback[s] (click to add your comment)