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

Is this meaningfully more portable than #!bash though?


In a sibling thread someone pointed out that #!bash doesn't actually work if you're calling it from bash, and appears to only work with zsh.

I just tried it and they were absolutely right, so `#!/usr/bin/env bash` is definitely more portable in that it consistently works.


This mechanism doesn't do a PATH lookup: #!bash would only work if bash was located in your current working directory.




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

Search: