To recap my understanding, and what your links say, /usr/bin/env
performs two functions:

1) It's main purpose, hence the name, is to exec() with a clean environment.

2) When deciding what to exec(), it searches the $PATH.

Because of #2, a convention has developed wherein /usr/bin/env can be
used in shebang lines to avoid needing to hardcode the location of the
interpreter. That is, I can use "/usr/bin/env perl", and it doesn't
matter whether my "perl" is in /usr/bin, /usr/local/bin, /usr/sbin,
/bin, or whatever. As long as it is in the $PATH, env finds it.

Likewise, when I run "/usr/bin/env python foo", env searches the $PATH
for something named python and exec()s the first one it finds.

If there is no python in my $PATH, it will not find anything.


You are proposing that:
  /usr/bin/env python foo
be equivalent to (for example):
  /usr/bin/python3 foo

I'm saying that's not how env behaves. It simply searches the path for
"python". It doesn't translate that to "python3", and why should it?

You have said your system DOES behave that way.

Can you give the results of the following commands:

$ which python
$ python --version
$ /usr/bin/env python --version

-- 
Richard

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to