This file contains several shell scripts that allow various interesting customizations of your user environment. The aliases
file contains a list of aliases that I personally find useful. The files bash_shell
and tcsh_shell
contain commands that modify the shell behavior and environment. Finally, the file settitle
contains functions and aliases that will dynamically update the title bar of your dtterm or xterm window with the full path of your current working directory.
In order to use these files directly, you must first be using either tcsh
or bash
as your command interpreter shell. Since csh
is the default and supported shell for your CNS computing id (used both on GPU and on the cad machines in CEB 531), I'd recommend that you use tcsh
. Tcsh
has the same command syntax as csh
, but has an enriched feature set, including a command-line editor, filename and word completion, and a more customizable environment. It also has the advantage of compatibility with csh
, so all of the environmental configurations that you are currently using will continue to work.
Bash
, in my opinion, is the better shell, but I do not believe it is officially supported by CNS. Thus, their online documentation uses tcsh
and csh
syntax, and has to be adapted for use with bash
. However, bash
does seem to be configured correctly (it can find maxplus2, anyhow... :-) ). Also, a note to computer engineers: bash
is more popular among computer science students, since it is the default shell for Linux, and is thus a lot better supported on Computer Science machines.
In any event, you can use either shell. I've provided nearly equivalent sets of files for each shell, and provide instructions for how to painlessly use these files. If you don't know what shell you are using, or are not using tcsh
or bash
, then refer to the next section, Changing your Shell and then follow the directions below. Finally, note that these script files can be used for all of your computer accounts: your CNS account (on GPU and the cad stations...configure separately, since each has a different home directory), your EE account (on nyquist and the HP machines in CEB 540), and your CS account (on ohaton, obed, the cab machines, the gsb machines, etc).
.tcsh_configs
which contains the three script files.
.tcshrc
in your home directory, create it with the following contents:
source ~/.cshrc
source ~/.tcsh_configs/aliases
source ~/.tcsh_configs/tcsh_shell
source ~/.tcsh_configs/settitle
You can leave out some lines if you decide that you don't want to use those files after all. If you do have the file .tcshrc
, then just add the last three lines shown above to the end of that file.
.bash_configs
which contains the three script files.
.bashrc
in your home directory. If you don't, you will have to obtain the standard copy of it from the system-dependant location. Contact the lab administrator or ask one of your peers. When you get it, add the following lines to the end:
source ~/.bash_configs/aliases
source ~/.bash_configs/bash_shell
source ~/.bash_configs/settitle
You can leave out some lines if you decide that you don't want to use those files after all.
The method for changing your shell, unfortunately, is a system-dependant process. Here, I will only give instructions for changing your CNS login shell, which will affect the shell you use for both GPU and the cad lab. Other methods involve the chsh and passwd -s commands. Ask your sysadmin or your peers if you cannot figure out how to change the shell on other systems.
In order to determine what shell you are using, you can do one of two things.
youruid
is your user id for that system. The output should be your entry from the system password file, which should list your shell in the last field.
gpu.srv.ualberta.ca
youruid
is your user id for that system. You will be asked to enter your password.
Aliases are user-defined command names that allow you to use less keystrokes for commonly used commands. For example, aliasing lsl to ls -lF means that typing lsl at the prompt is equivalent to executing the ls -lF command. Examine the file in order to view the aliases that I have defined. Feel free to add, delete, and change them as you see fit. Aliases are very much a matter of personal preference. :-)
The files tcsh_shell
and bash_shell
contain shell customization commands. I'm not going to explain them all, since they are all described in great detail in the man pages for the shells. Furthermore, there are many other options that I did not customize that you might wish to. Perhaps the best example of this is the prompt variable, which is highly customizable. I prefer the form "gargus@cad10:(cwd)$ "
, since it lists who I am logged on as (useful when you have several user ids on that machine, such as root access, or a course account), what machine I am logged on to (useful when having several sessions to different machines open), and the immediate working directory I am in (relying on settile
to give me my full path). Again, these customizations are very much a matter of personal preference, and are well documented in the man pages.
The settitle
file contains the specific customization that communicates with terminal windows to dynamically change their titles as you change your current directory. In tcsh
, this is accomplished by aliasing the command cwdcmd, which is a special shell command that gets executed everytime the current working directory. In bash
, the same effect is accomplished by defining a shell function named settitle
that is called after commands that change the current working directories. In order to disable the dynamic title changes, merely unalias the cwdcmd
or override the function definition of settitle
with a function that has no body.
Here are the files:
bash_configs.tar.gz (2421 bytes)
tcsh_configs.tar.gz (1130 bytes)
More information on the settings can be found in the extensive shell online documentations, which can be obtained by typing man tcsh and man bash, depending on which shell you are using. These are the best resources and references to describe the above modifications.
Please feel free to submit comments, questions, and feedback in general on this topic to the address shown at the bottom of the page. I will answer your questions and update this document to improve its overall clarity and utility.