Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 8
    Excellent analysis. We appreciate it. Commented Feb 20, 2020 at 23:55
  • 4
    The question wasn't specific to Python. I don't think you can safely assume that other interpreters will be installed as, for example interpX and interpX.x. For example, the system I'm using at the moment has perl, perl5.26.3, and perl5.30.1. Another has perl and perl5.26.1. Neither has a perl5 command. Also, you didn't mention where the pythonX and pythonX.x interpreters on any of the systems you tested were installed. If they were all in /usr/bin then your experiment doesn't demonstrate any advantage of #!/usr/bin/env pythonX.x over #!/usr/bin/pythonX.x. Commented Feb 21, 2020 at 2:55
  • 3
    Note that not every Linux system complies to the FHS, not by a long shot. And, paraphrasing the old saying, "Not all the world is Linux". Many Unix(y) systems have Python, Perl, even bash or tcsh as "optional, unsupported third party additions", presumably under /usr/local or /opt/*packagename* or some really exotic placements. Commented Feb 23, 2020 at 4:01
  • 6
    UPVOTED for the formatting alone, never mind the very useful answer. Commented Aug 26, 2020 at 13:30
  • 1
    @TeemuLeisti I try to save other technologists the effort of solving the same problems I bump into. So it's nice to hear somebody found my solution useful, especially when it's involved a fair amount of testing & documentation such as this one has. Most obliged for your kind words! Commented Aug 26, 2020 at 18:22