How to make a multi-character parameter in UNIX using getopt? -
i'm trying make getopt command such when pass "-ab" parameter script, script treat -ab single parameter.
#!/bin/sh args=`getopt "ab":fc:d $*` set -- $args in $args case "$i" in -ab) shift;echo "you typed ab $1.";shift;; -c) shift;echo "you typed c $1";shift;; esac done
however, not seem work. can offer assistance?
getopt doesn't support looking for. can either use single-letter (-a
) or long options (--long
). -ab
treated same way -a b
: option a
argument b
. note long options prefixed 2 dashes.
Comments
Post a Comment