|
|
|
|
|
by throwaway892238
1377 days ago
|
|
The main reason to use env shebangs is versioning. MacOS ships Bash v3, but Homebrew installs Bash v5. Which shebang will you use - #!/bin/bash, #!/usr/bin/bash, #!/opt/homebrew/bin/bash, #!/usr/local/homebrew/bin/bash ? Same for different versions of Python (in venvs, pyenvs, etc) and other applications where you may want to run different versions. With the env shebang you can always change your PATH to choose your version. |
|
It does make sense for your pythons and rubies but not really for bash.
Side note: zsh allows for #!bash but that's only interpreter I found that does that