Remove bashisms

Replaces https://github.com/creationix/nvm/pull/345