On Sun, Apr 30, 2006 at 05:46:18PM -0700, James G. Sack (jim) wrote:
>George Georgalis wrote:
>> I was just looking a python program written by a
>> long time kplug member.  It starts with this line...
>> 
>> #!/usr/bin/env python
>> 
>> The env man page doesn't help me much... what does it do?
>
>The example above allows you to make a python script executable without
>knowing the full path to python (but, assuming it _is_ found in the $PATH).
>
>As I understand it, this method gained popularity in days when python
>was less commonly delivered in a "standard" distribution, and might
>thus, on any given machine, be found in /usr/local/bin or maybe even
>/opt/bin or some-such.
>
>Since env _is always_ in /usr/bin, and env _would_ search the $PATH,
>then the above worked (#!python would NOT work -- you need an abs, path)

Weird. But it makes a lot of sense too. Sounds like a good idea
for non "/bin/sh" scripts, to keep them portable.

>Nowadays, I tend to just use
> #!/usr/bin/python

I suppose the same for perl? that is often in different places,
even in this modern age now. :)

Maybe this is a good time to plug pkgsrc. Works great in Linux.
Just have to remember to use bmake when you install any of the
3000 packages. eg with pkgsrc, you can have the same versions of
all your favorite programs on all your different distro and OS.

Cheers,
// George


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:[EMAIL PROTECTED]


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to