Why is '#!/usr/bin/env python' supposedly more correct than just '#!/usr/bin/python'?

后端 未结 5 2109
悲哀的现实
悲哀的现实 2020-12-12 20:34

Anyone know this? I\'ve never been able to find an answer.

5条回答
  •  旧时难觅i
    2020-12-12 21:09

    From wikipedia

    Shebangs specify absolute paths to system executables; this can cause problems on systems which have non-standard file system layouts

    Often, the program /usr/bin/env can be used to circumvent this limitation

提交回复
热议问题