POSIX shell compatibility

I rewrite it to POSIX syntax, so now it should works in all shells compatible with bourne shell (`#\bin\sh`), like `bash`, `zsh`, `ash`, `dash`, etc.