How do I parse command line arguments in bash? - Stack Overflow
getopt()/getopts() is a good option. Stolen from here: The simple use of "getopt" is shown in this mini-script: #!/bin/bash echo "Before getopt" for i do echo $i done args=`getopt abc:d $*` set -- $args echo "After getopt" for i do echo "-->$i" done What
stackoverflow.com |