Skip to content

Instantly share code, notes, and snippets.

@yarikoptic
Created February 17, 2013 03:23
Show Gist options
  • Save yarikoptic/4969949 to your computer and use it in GitHub Desktop.
Save yarikoptic/4969949 to your computer and use it in GitHub Desktop.
tiny script to invoke any available python version with given cmdline arguments
#!/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