Skip to content

Instantly share code, notes, and snippets.

@arcanis
Created June 3, 2012 10:24
Show Gist options
  • Save arcanis/2862946 to your computer and use it in GitHub Desktop.
Save arcanis/2862946 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
# Usage :
# $> sudo set-python-version 2; python -V
# Python 2.7.2
# $> sudo set-python-version 3; python -V
# Python 3.2.2
python=$(which python)
pythonX=$(which python$1)
if [ -h "$python" ]; then
rm "$python"
ln -s "$pythonX" "$python"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment