开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜