fixed for posix compliance so it works cross os

Gems from #bash:

- `getopt` only works as scripts expect it on linux systems
- posix standards only say what has to happen when you enclose vars in quotes