diff --git a/heavy_script.sh b/heavy_script.sh index 82087420..29f90c3e 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -87,8 +87,8 @@ do eval nextopt=${!OPTIND} # existing or starting with dash? if [[ -n $nextopt && $nextopt != -* ]] ; then - OPTIND=$((OPTIND + 1)) - update_limit="$OPTARG" + OPTIND=$((OPTIND++)) + update_limit="$nextopt" else update_limit=1 fi @@ -99,8 +99,8 @@ do eval nextopt=${!OPTIND} # existing or starting with dash? if [[ -n $nextopt && $nextopt != -* ]] ; then - OPTIND=$((OPTIND + 1)) - update_limit="$OPTARG" + OPTIND=$((OPTIND++)) + update_limit="$nextopt" else update_limit=1 fi