How to manage python shebang on mixed systems?

Christian Gollwitzer auriocus at gmx.de
Mon Nov 7 14:58:08 EST 2022


Am 07.11.22 um 10:28 schrieb Chris Green:
> Chris Green <cl at isbd.net> wrote:
>>> 3: with your pseudo "python3" script in place, make all the scripts use
>>> the "#!/usr/bin/env python3" shebang suggested above.
>>>
>> Yes, that sounds a good plan to me, thanks Cameron.
>>
> Doesn't '#!/usr/bin/env python3' suffer from the same problem as
> '#!/usr/bin/python3' in the sense that the env executable might not be
> in /usr/bin?
> 
> Wouldn't '#! env python3' be better?

Does this even work? I thought that, since the #! is resolved by the 
kernel, an absolute path is required, and that the whole purpose of the 
/usr/bin/env thing is to search the path (because it is universally 
installed in /usr/bin) and to possibly set other environment variables



	Christian


More information about the Python-list mailing list