Command line arguments for Bash with getopts


/ Published in: Bash
Save to your folder(s)

How to combine getopts options with (-) and non-options.

After processing all options, variable OPTIND contains the value of the first non-option (commandline argument that doesn't start with (-)).

Shift command will clean previous commandline options.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.