Write the wrapper script.
#!/bin/bash
if [ $(hostname) == "oldystem" ]; then
exec /usr/bin/python $*
else
exec /usr/bin/python2 $*
fi
From: Python-list <[email protected]> on
behalf of Chris Green <[email protected]>
Date: Sunday, November 6, 2022 at 3:22 PM
To: [email protected] <[email protected]>
Subject: Re: How to manage python shebang on mixed systems?
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
rbowman <[email protected]> wrote:
> On Sun, 6 Nov 2022 10:03:50 +0000, Chris Green wrote:
>
>
> > Is there a neat way of handling this? I could write a sort of wrapper
> > script to run via the shebang but that seems overkill to me.
>
> Can you symlink?
Not really, since the system where there's no python3 is one where I
only have user access.
--
Chris Green
ยท
--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!gN4FcCAwYqK8bafmF2dr_EB9nahZcdNmU91bHuymdlakU27cNTnIwQ_FckF9PBZlllGnW_vlEjQ$<https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!gN4FcCAwYqK8bafmF2dr_EB9nahZcdNmU91bHuymdlakU27cNTnIwQ_FckF9PBZlllGnW_vlEjQ$>
--
https://mail.python.org/mailman/listinfo/python-list