Hacker News new | ask | show | jobs
by hamandcheese 205 days ago
Is this meaningfully more portable than #!bash though?
2 comments

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.