Customizing Unix Programs

Most Unix programs use a resource file to store application-specific settings. These are considered system files (hence their name starts with a dot) and their name generally ends in rc. Examples: .cshrc (the settings file for the C-shell),  .therc (the settings file for the, the Hessling-editor, a Unix clone of XEDIT), and .exrc (the settings file for the text editor vi). These take the place of the various XEDIT profiles in CMS.

Customizing Your Shell: .profile or .cshrc

A shell is the process that interprets your commands (like command.com in DOS). On our two big Unix-machines, the default shell that you'll find yourself in when you log in is called ksh (the Korn-shell). You recognize that by the $ symbol on the command line (known as the prompt). ksh stores its startup settings in a file called .profile, the equivalent of PROFILE EXEC on CMS. Let us take a closer look at some of the settings:

In line 3, PATH is an environment variable (info that Unix will keep available for you during this whole session), which is made available to Unix by the export command (line 5). It tells Unix where the executable programs are located (Unix won't find other programs elsewhere) by listing several directories separated by colons. The last directory listed is . (the current directory), so if Unix couldn't find your command vrksfrst (just for example) anywhere else, it will finally look in the current directory for it. If it can't find it there, it will say ksh: vrksfrst: not found to tell you that this command doesn't exist (strangely enough). Yes, the order in which the directories are listed is the search order.

Lines 7-9 contain a check whether you have any new mail, and a statement executed conditionally to let you know if you do. On the right, a comment (indicated by #).

Near the end, some aliases (just as in CMS), so I can type dir to see a complete, long listing of my files one screen at a time (just as in DOS). You might want to make some aliases resembling CMS commands to make it easier to remember your standard tasks (e.g. add a line alias rl=pine). It is even possible to re-define existing commands this way, e.g. if you want the ls command to always display a long listing, you could add a line alias ls='ls -l' to the .profile file. Note the quotes - they are needed if your new command contains spaces or special characters, or a sequence of commands. In the dir example, you see such a sequence: first ls -al produces a (possibly very long) listing of all your files, then the output of this process is piped into more, which displays its input one screen at a time. Piping means to feed the output of one program into another program. This is indicated by the vertical bar, known as the "pipe-symbol".

The C-shell profile: .cshrc

On some Unix systems, your startup shell may be csh rather than ksh (you can also change to csh on our machines, using the command chsh, that is change shell). The C-shell (csh) is considered by many to be more convenient than the Korn-shell (ksh). Its settings are kept not in .profile, but in .cshrc, which looks quite similar to .profile. For details, check the literature.

Here just a few big differences that can drive unexperienced users crazy: in the C-shell, you don't use export for environment variables, but setenv - and only for things newly named by you or an application. Shell-variables (these are other variables that the system already knows about, such as term, the terminal type, or path) are given a value by the set command. Note the different syntax for setting the path in the two different shells. (This screenshot was not taken on a Computer Center machine, so some of these settings may not make sense there.)

Customizing Printing

To make a specific printer your default printer (e.g. SEL2058), you put a line or two into your shell's settings file such as PRINTER=SEL2058 and (on next line) export PRINTER (for ksh, in .profile) or setenv PRINTER SEL2058 (for csh, in .cshrc).

Customizing Your Editor

the

Check here for documentation on the .therc settings file.

vi

While vi is a full-screen editor (meaning you can type anywhere on the screen), it uses a command-line editor called ex for basic functions, such as searching, quitting, or writing out a file. These ex-commands are the ones you type on the vi-command line (they start with : or / or so). Hence the settings file for vi is called .exrc (and not .virc). I won't give here a complete documentation of the available settings, but some useful ones are :set showmode and :set number which turn input-mode-notification and line numbers on. You can set these within vi, no need to actually edit the settings file.

Customizing pine

The file .pinerc, which stores the settings for pine, should not be hand-edited (but you may want to print it to read all the available options offline). Instead, use s (for Setup) and then c (for Configuration) from the pine main menu. Help for each feature is available by typing ? while having the feature selected. Type x to check/uncheck a feature in the feature-list.

Configuring a network printer in pine is another task available from the setup menu.