Extra Notes
Changing the login shell: chsh
A user can change the default shell using the 'chsh' command,
which stands for "change shell". In doing this, the full path
must be specified (e.g. /bin/tcsh or /bin/bash).
- enter the command: chsh
- when prompted, enter the user's password
- enter the full path of the new shell: /bin/tcsh
Note: on Mac OS X, it is good to use the -s options:
chsh -s /bin/tcsh
-----------------------------------------------------------------
Setting the PATH under /bin/tcsh:
The PATH variable controls the set of directories that are
search for valid commands.
There are 2 ways to update the PATH variable in the T-shell
(or C-shell), either by updating the path shell variable, or
by updating the PATH environment variable, directly. This
is because updating either path or PATH affects the other.
Adding ~/abin to the path may be done by:
set path = ( $path ~/abin )
Adding ~/abin to the PATH may be done by:
setenv PATH {$PATH}:~/abin
These commands have identical effect. Either can be put
into the ~/.cshrc file to affect the PATH every time a new
shell is started (e.g. by opening a new terminal window).
Note that under the newer Linux environments, the user will
need to log out and log back in for this change to ~/.cshrc
to fully take effect.
-----------------------------------------------------------------
Setting the PATH under /bin/bash
The command to use for this shell is:
export PATH=$PATH:~/abin
This command may be put in the ~/.bashrc file, similar to
the ~/.cshrc file, above.
-----------------------------------------------------------------
What does '~' mean?
The shell interprets the '~' character as short-hand for the
user's home directory. To illustrate this, assume that some
user's login name is pickle, and that on their machine, all
users have home directories under /home. Then for the user
"pickle", any of the following 'cd' commands will change to
their home directory (/home/pickle):
cd
cd ~
cd /home/pickle
cd ~pickle
Note the last example. The shell will interpret ~USER_NAME
as shorthand for the home directory of user 'USER_NAME'. So
if there were a user named 'pizza' on the computer, then the
following commands would change to pizza's home directory:
cd /home/pizza
cd ~pizza
For another illustration, let us suppose that user 'pickle'
has the directory 'abin' under their home (so the full path
is /home/pickle/abin). Then they could execute the command
'3dDeconvolve' by entering either of the commands:
~/abin/3dDeconvolve
/home/pickle/abin/3dDeconvolve
If somewhere in their ~/.cshrc file, they have the command:
set path = ( $path ~/abin )
then they would only need to use the shorthand command:
3dDeconvolve
because '3dDeconvolve' would be found (by the shell) under
'/home/pickle/abin'.
-----------------------------------------------------------------