while getopts ':s:e:ci:z:n:d:m:' opt; do
echo -- $opt
echo -- $OPTORG
done
For The above snippet when executed with
bash a.sh -c -m lsdjfe -s "all ab" -d all
Results into
-- c
--
-- m
--
-- s
--
-- d
--
Where as i was expecting
-- c
--
-- m
-- lsdjfe
-- s
-- all ab
-- d
-- all
What am i doing wrong?