The bash script line:
for ((i = 0 ; i < ${#v1parts[@]} ; i++ )); do
doesn't format properly. The # is incorrectly interpreted as the beginning of a comment.
That's a problem with google-code-prettify which stackoverflow uses to render code; not with stackoverflow itself.