The default shell environment in our Linux Lab is bash. However some software used by our students may require a different shell, such as tcsh.
Please Read This First
ECE Computing does not actually recommend you switch your shell, since it can (and frequently does) completely break an inexperienced user’s login to a Linux computer. Instead, we recommend leaving your login shell alone and just switching to another shell as needed, using one of the following commands (replace “tcsh” with whichever shell you wish to run; e.g. csh, zsh). Option 2 is preferred, but either will work:
(Option 1) /bin/tcsh (Option 2) exec /bin/tcsh -l # that's a lowercase "L", not a "one"
However, we realize some people prefer to work in a shell other than bash by default.
How to Switch Your Shell
Technically speaking, at present it’s not possible to change your default shell away from bash on ECE systems. Practically speaking, though, you can accomplish the same thing by adding the following lines to the file .bashrc in your home directory:
# Switch interactive shells from bash to something else (like zsh or tcsh) by default # To stay in bash, run "NOSWITCH=1 bash" MY_SHELL="tcsh" if [[ $- == *i* && -z $BASH_EXECUTION_STRING && -t 0 && -z $NOSWITCH ]]; then MY_COMMAND=$(command -v "$MY_SHELL" 2>/dev/null) if [[ -n $MY_COMMAND && -x $MY_COMMAND ]]; then export SHELL="$MY_COMMAND" if shopt -q login_shell; then exec "$MY_COMMAND" -l else exec "$MY_COMMAND" fi else echo "Did not find $MY_SHELL - staying in bash." >&2 fi fi unset MY_SHELL MY_COMMAND NOSWITCH
Copy everything *exactly* as shown above – even the spacing. In the first non-comment line you can change “tcsh” to any valid shell, such as “zsh” – but be careful not to add any spaces around the equals sign if you do that.