Created
February 17, 2013 03:23
-
-
Save yarikoptic/4969949 to your computer and use it in GitHub Desktop.
tiny script to invoke any available python version with given cmdline arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple helper script to run something with all available versions of Python | |
# (under /usr/bin and /usr/local/bin python2.*) | |
set -eu | |
failed= | |
for python in /usr/{,local/}bin/python[23].[0-9]{,.*}{,-dbg} | |
do | |
[ -e "$python" ] || continue | |
echo "Testing using $python" | |
$python "$@" || failed+=" $python" | |
done | |
if [ ! -z "$failed" ]; then | |
echo "E: Failed with $failed" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment