made it to be a bit more POSIX compliant.. should work with dash on Ubuntu now