I guess this is close to what you started the thread with (and had already left 
my head).

Jed Brown <[email protected]> writes:

> Jacob Faibussowitsch <[email protected]> writes:
>
>>> command -v $pyimpls > /dev/null && echo Using: $pyimpl && exec $pyimpl "$@"
>>
>> As Lisandro noted below, command -v would have to be swapped out since it 
>> also picks up aliases and doesn’t error out.
>
> Right, which is better.
>
> diff --git i/configure w/configure
> index 4538314871..78e72da1a2 100755
> --- i/configure
> +++ w/configure
> @@ -1,4 +1,11 @@
> -#!/usr/bin/env python
> +#!/bin/sh
> +
> +"true" '''\'
> +for pyimpl in python3 python python2; do
> +  which $pyimpl > /dev/null && echo "Using $pyimpl for Python" && exec 
> $pyimpl "$0" "$@"
> +done
> +exit 127
> +'''
>  
>  import sys, os
>  

Reply via email to