Hello all,
I have a pretty insane script with lots of flags:
Code:
while getopts "h:a:u:f:t:e:r:n:s:c:l:j:i:q:w:o:L:B:W:" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
a)
accelurl=$OPTARG
;;
u)
unaccurl=$OPTARG
;;
t)
times=$OPTARG
;;
f)
filename=$OPTARG
;;
e)
emailto=$OPTARG
;;
r)
reten=$OPTARG
;;
q)
hq_pop=$OPTARG
;;
n)
ny_pop=$OPTARG
;;
s)
sf_pop=$OPTARG
;;
c)
chi_pop=$OPTARG
;;
l)
ldn_pop=$OPTARG
;;
j)
jpn_pop=$OPTARG
;;
w)
tai_pop=$OPTARG
;;
o)
la_pop=$OPTARG
;;
L)
Linux=$OPTARG
;;
B)
BSD=$OPTARG
;;
W)
Windows=$OPTARG
;;
?)
usage
exit
;;
esac
done
now I want to be able to add 2 new flags. -F1 & - F2
so for example I could run this:
./myscript -F1 My_Label1 -F2 MY_second_Label
however when I try and just add
F1
F2
Quote:
while getopts "h:a:u:f:t:e:r:n:s:c:l:j:i:q:w:o:L:B:W:L1:L2:" OPTION
Code:
L1)
Label1=$OPTARG
;;
L2)
Label2=$OPTARG
;;
This does not work.
Any ideas? Is the problem because it is 2 characters long?
Thanks
~Dynacade