1

shebang env preferred python version

view story
linux-howto

http://stackoverflow.com – I have some python-2.x scripts which I copy between different systems, Debian and Arch linux. Debian install python as '/usr/bin/python' while Arch installs it as '/usr/bin/python2'. A problem is that on Arch linux '/usr/bin/python' also exists which refers to python-3.x. So every time I copy a file I have to correct the shebang line, which is a bit annoying. On Arch I use #!/usr/bin/env python2 While on debian I have #!/usr/bin/env python Since 'python2' does not exist on Debian, is there a way to pass a preferred application? Maybe with some shell expansion? I don't mind if it depend (HowTos)