diff --git a/test.sh b/test.sh index 3b278ab..2adf0e4 100755 --- a/test.sh +++ b/test.sh @@ -20,10 +20,10 @@ fi while getopts ':a:b:c:r:' flag; do case "${flag}" in - r) $flag=$OPTARG; echo "R - $r" ;; - a) $flag=$OPTARG; echo "A - $a" ;; - b) $flag=$OPTARG; echo "B - $b" ;; - c) $flag=$OPTARG; echo "C - $c" ;; + r) r=$OPTARG; echo "R - $r" ;; + a) a=$OPTARG; echo "A - $a" ;; + b) a=$OPTARG; echo "B - $b" ;; + c) a=$OPTARG; echo "C - $c" ;; :) echo "Invalid option: $OPTARG requires an argument" 1>&2 ;; esac done