I have written below code for using long options with getopts
, but it doesn't work (arguments have no effect on values of the variables). What is the correct syntax?
while getopts "c:(mode)d:(file1)e:(file2)" opt; do
case $opt in
-c|--mode)
mode=$OPTARG
;;
-d|--file1)
file1=$OPTARG
;;
-e|--file2)
file2=$OPTARG
;;
esac
done