UK National HPC Service

Computer Services for Academic Research Logo
Home | Helpdesk | Machine Status | Search | Apply
 

3. Login shell

Available Login Shells

At login to a UNIX machine, your commands are interpreted by a "login shell". The login shells supported by CSAR are the standard Bourne shell (sh), Korn shell (ksh), the C shell (csh), and the extended (or "turbo") C shell (tcsh). In addition the GNU Bourne Again SHell (bash) is supported on newton, and available but unsupported on the Origins. zsh is available on newton but not supported.

When your account is set up you will be allocated one of these shells as your login shell. To change this to another supported login shell contact your PI who can change it using the CSAR Registration System.

When you log in various default configuration files are executed. These set up the default environment. After the default configuration has been set up, your personal environment is configured if the relevant file exists in your home file store:

Shell Environment File
sh .profile
csh .cshrc and then .login
ksh .profile
tcsh .cshrc and then .login
bash .bash_profile or .bash_login or or .bashrc or .profile

When your account was created you will have been given a standard version of the relevant file(s) for your login shell.

Different files may be executed when a shell is started that is not a login shell, and also when a shell exits. More information can be found in the manual page for the shell you are using.

Changing your Shell

To change shells temporarily enter the executable name of the new shell at your prompt. You will then be using this shell until you exit from it to the former shell.

To determine your current login shell enter echo $SHELL at the prompt. Alternatively, you can enter grep {username} /etc/passwd and the last entry is {username's} login shell.

To permanently change your login shell to a supported shell please contact your PI or the helpdesk.

If you wish to use an unsupported shell as your default you will need to edit the relevant login file (see above table) to firstly re-assign the SHELL environment variable and then execute it. Examples are given below:

For sh based shells:

OS=`uname -s`
if [ ${OS} ="IRIX64" ]
then

export SHELL=/share/apps/unsupported/bin/bash
exec /share/apps/unsupported/bin/bash $*
fi

For csh based shells:

set OS=`uname -s`
if ($OS == IRIX64) then
setenv SHELL /share/apps/unsupported/bin/bash
exec /share/apps/unsupported/bin/bash $*
endif

Modules (www.csar.cfs.ac.uk/software/modules.shtml) will be setup automatically for your default shell. However if you change shell often modules are not setup (for example bash on the origins), in this case you will need to reinitialise modules.

Initialisation files appear in the directory /opt/Modules/default/init on Newton and /sanopt/modules/modules/init/ on the origins. These must be sourced in order to initialised. This is achieved by using the source command for tcsh and csh, and using the . (dot) operator for bash, ksh and sh.

For example, to initialise modules for bash on the origins you would need to do

. /sanopt/modules/modules/init/bash

Warning: You should always test changes such as those above by, for example, saving your changes and opening another new, different window (i.e. without closing the window where you are editing your login files) to see what happens. If you don't test then be aware that a minor mistake could mean that you get logged out immediately each time you try to login.

Previous: Accessing the machines Next: Files and Filestore

Page maintained by This page last updated: Tuesday, 24-Aug-2004 10:44:48 BST