[katello-devel] Why #!/usr/bin/env ?

Adrian Likins alikins at redhat.com
Mon Jul 23 20:46:54 UTC 2012


On 07/23/2012 04:06 PM, Ewoud Kohl van Wijngaarden wrote:
> On Mon, Jul 23, 2012 at 03:37:43PM -0400, Jordan OMara wrote:
>> On 23/07/12 21:35 +0200, Miroslav Suchy wrote:
>>> Why do you guys prefer #!/usr/bin/env ?
>>>
>>> I seen it twice in today pull requests and git grep show me it is
>>> used several times in our code.
>>>
>>> I understand it may put in game e.g /usr/local/bin/ with locally
>>> compiled python/ruby. But is it what we want? Do we guarantee,
>>> that our code will work with locally modified version of
>>> python/ruby?
>>>
>>> I always used plain #!/usr/bin/python or #!/usr/bin/ruby as it
>>> gives me more control and less bug reports.
>>>
>>> Mirek
>>>
>> I actually had a stranger from the internet make a pull request on one
>> of my random github projects and correct a ruby script from
>> #!/usr/bin/ruby ->  #!/usr/bin/env ruby ; the same way we have it in
>> our scripts. I'm curious as well
> Can't speak for ruby, but in the python world virtualenv[1] is popular
> among developers. Then python can live in ~/myenv/bin/python as well as
> many dependencies under ~/myenv/lib/python2.X/site-packages which
> /usr/bin/python will never find, or worse, different versions. I imagine
> something similar may exist in the ruby world.

Shouldn't distutils do the right thing in this case?
http://docs.python.org/distutils/setupscript.html#installing-scripts

Adrian




More information about the katello-devel mailing list