i using getopts but when i type in the argument it not working. Is there anything wrong wif my script? bcos when i enter bash filename -P -S , i should see "hello" msg but i don.
#!/bin/bash
while getopts "PS" opt;
do
if [ $# -eq 2 ]; then
case "$opt" in
PS) echo "hello"
;;
\?) echo "wrong!!"
esac
else
echo "Required 3 Args!!!"
fi
done