Here is the code:
for var in "$@";do
$ bash MyScript.sh duck duck goose
Use a math context to perform math. The bash-specific syntax for this is
(( v += 1 )) # not POSIX compliant, not portable
Alternately, a POSIX-compliant syntax for a math context is
v=$(( v + 1 )) # POSIX-compliant!
: $(( v += 1 )) # POSIX-compliant!
There's also the non-POSIX-compliant
let v+=1 # not POSIX compliant, not portable, don't do this
...and the similarly non-POSIX-compliant
declare -i v # not POSIX compliant, not portable, don't do this # ...also makes it harder to read or reuse snippets of your code # ...by putting action and effect potentially further from each other. v+=1