This is my shell script-
while getopts ":m" opt; do
  case "$opt" in
    m)
      echo "-m was triggered! $OPTARG was entered" >&2
      ;;
    j)
       echo "-j was triggered! $4 was entered" >&2
       ;;
    k)
       echo "-k was triggered! $6 was entered" >&2
       ;;
   \?)
      echo "Invalid option: -$OPTARG" >&2
      ;;
  esac
done
shift $(($OPTIND - 1))
when i run the shell script-
./test.sh -m hello
I get the output this way-
-m was triggered!  was entered
Where am i going wrong? Please bear with me as I am totally new to shell script.
 
    