Skip to content

Instantly share code, notes, and snippets.

@docunext
Created October 10, 2010 23:31
Show Gist options
  • Select an option

  • Save docunext/619695 to your computer and use it in GitHub Desktop.

Select an option

Save docunext/619695 to your computer and use it in GitHub Desktop.
changeruby () {
if [ $1 == "18" ]
then
echo "Changing to Ruby 1.8"
NEWPATH=`echo $PATH | sed 's/:\/var\/lib\/gems\/1.9.1\/bin/:\/var\/lib\/gems\/1.8\/bin/g'`
echo "PATH=${NEWPATH}" > ${HOME}/.config/mypath
source ${HOME}/.bashrc
hash -r
fi
if [ $1 == "19" ]
then
echo "Changing to Ruby 1.9"
NEWPATH=`echo $PATH | sed 's/:\/var\/lib\/gems\/1.8\/bin/:\/var\/lib\/gems\/1.9.1\/bin/g'`
echo "PATH=${NEWPATH}" > ${HOME}/.config/mypath
source ${HOME}/.bashrc
exec bash
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment