Correct interpreter, fix gofmt execution.

Fixes:
* Script used bash syntax, e.g: $(...), not plain bourne shell (sh).
  Changing the interpreter in line with this.
* The line output=gofmt -w "$file" interpretted "output=gofmt" as
  setting an environment variable, and -w as a command. This change
  corrects to what was intended.