I'm having problems with getopts command.
When I want to use an option that requires the SAME argument, it stops running the program after the first option that requires an argument (-i for example). So when I want it to take the options -id or -i -d it will stop running the while loop after the "-i" option is used and ignore the -d option.
How can I get the loop to continue and for the -d option to execute as well?
The format for the arguments passed can be: "-id argument" or "-i -d argument"
I'm using $p currently to grab the final argument to pass for each option currently. this is linux ubuntu shell in dash:
To make the code smaller and quicker to read:
for p do :; done
echo arguments === $1 $2 $3
echo p = $p
while getopts ":hva:b:d:g:i:u:w:" opt;
do
case "$opt" in
i)
checkdir $p
fileinfo $p
;;
***OTHER OPTIONS FOLLOW SIMILAR FORMAT***
esac
done