This is not specific to cygwin; there is a syntax error line 26:
echo "-c was triggered with argument: $[OPTARG}"
replace [
with {
and it will work.
Note for line 11: echo ${i}
is wrong, use echo ${!i}
to print the i-th arg.
Note for line 10: the syntax $[ ]
is now obsolete; you may use (( ))
instead like this :
((i++))
or even better, replace lines 8-12 by:
for ((i=0; i<10; i++)); do echo ${!i}; done