path in shebang
I have /bin/bash (3.2) and /usr/local/bin/bash (4.0) on my computer. In the $PATH environment variable, bash 4.0 is prior to bash 3.2.
in my bash script shebang, I don't like to explicitly use:
#!/usr/local/bin/bash
开发者_如何学运维
I'd like to find bash based on $PATH priority. How to do it? Thanks!
you can always try
#!/usr/bin/env bash
精彩评论