How to make a multi-character parameter in UNIX using getopt?
I'm trying to make a getopt command such that when I pass the "-ab" parameter to a script, that script will treat -ab as a single parameter. #!/bin/sh args=`getopt "ab":fc:d $*` set -- $args for i in $args do case "$i" in -ab) shift;echo "You typed ab $1.";shift;; -c) shift;echo "You typed a c $1";shift;; esac done However, this does not seem to work. Can anyone offer any assistance? getopt doesn't support what you are looking for. You can either use single-letter ( -a ) or long options ( --long ). Something like -ab is treated the same way as -a b : as option a with argument b . Note that