I created a bash script and i need help with getopts
Each options have arguments :
while getopts ":a:b:c:" opt
do
case $opt in
a) echo "$OPTARG";;
b) echo "$OPTARG";;
c) echo "$OPTARG";;
/?) echo "wrong option $OPTARG";;
esac
done
If i want to use the same argument, i need to type -option arg for each options
./script.sh -a hello -b hello -c hello
hello
hello
hello
I would like to be able to use the script like a command, typing options all together when i have the same argument :
./script.sh -abc hello
Unfortunately bc is now the argument :
bc
Does anyone could help me please ?
Regards,