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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With