Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's very nice, it's POSIX-compliant when invoked as #!/bin/sh and sane when invoked as #!/bin/bash — exactly what I'd want.


If you want a portable script, then you don't want that behavior.


Then I wouldn't put #!/bin/bash at the top.


Your problem there is Ubuntu/Debian.

A bash script that runs as /bin/sh might not run as /bin/bash, until you set POSIXLY_CORRECT.

Easiest solution there is to move it to a better shell, usually a Korn variant.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: