On 2022-11-07 at 11:56:19 +0000, "Weatherby,Gerard" <gweathe...@uchc.edu> wrote:
> Write the wrapper script. > > #!/bin/bash > if [ $(hostname) == "oldystem" ]; then > exec /usr/bin/python $* > else > exec /usr/bin/python2 $* > fi Use "$@" (with the quotes) instead of a bare $*. The former preserves quoted arguments, while the latter does not. Also, it's probably more robust to check explcitly for python2 instead of depending on the hostname. Renaming hosts isn't a common operation, but in general, checking for what something *does* or *has* is better than checking for what it *is* (hey, look: duck typing!). Implementing both suggestions yields this: #! /bin/bash if [ -x /usr/bin/python2 ]; then exec /usr/bin/python2 "$@" else exec /usr/bin/python "$@" fi YMMV. -- https://mail.python.org/mailman/listinfo/python-list