Created
September 6, 2012 01:35
-
-
Save nvasilakis/3649702 to your computer and use it in GitHub Desktop.
Swap shells between log-ins
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
| # 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