Skip to content

Instantly share code, notes, and snippets.

@nvasilakis
Created September 6, 2012 01:35
Show Gist options
  • Select an option

  • Save nvasilakis/3649702 to your computer and use it in GitHub Desktop.

Select an option

Save nvasilakis/3649702 to your computer and use it in GitHub Desktop.
Swap shells between log-ins
# the function is named shange as a play of word for "shell change"
# just run shange if you have it on ~/.profile, /bin or
# both .bashrc and .tcshrc (not sure about the last for I'm not using tcsh)
# only if you are running this as a standalone script (in /bin etc)
# comment the "function shange {" and "}" lines.
function shange {
if [[ "$(basename $SHELL)" == "bash" ]]; then
echo "Changing to tcsh"
chsh -s tcsh
else
echo "Changing to bash"
chsh -s bash
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment