Example Startup file modifications for the Solaris Cluster

Index

return to index

Related Documents

return to index

Introduction

This page desribes the simple alterations whch you can make to supplement the supplied files. The supplied files all have names which begin with the dot character and all collectively called dotfiles in this text. You must not overwrite your supplied dotfiles with dotfiles of the same name from the old sunos cluster. If you do so you will "break" your account ie many commands and utilities will stop working. For most accounts the file .cshrc is protected from accidental alteration by the user.

A lot of work has gone into making the supplied dot files. It is unlikely that you will want to make alterations other than perhaps aesthetic ones such as your default prompt.

return to index

Customising via .postlogin and .postcshrc

You make changes by putting statements into either the file .postlogin or the file .postcshrc.
.postlogin
The statements in the file .postlogin are executed just once once when you log in. Normally you put the setting of environment variables in .postlogin. This is possible because if you openb another shell or window then it inherits a copy of the environment variables. There is therefore no need to define them all over agian.
.postcshrc
The statements in the file .postcshrc are executed every time you open a shell/window. You should keep this short. Normally you put the setting of aliases in .postcshrc.
See the index above for topics.

return to index

Changing the style of the prompt

The last character of the prompt is usually > for the tcsh shell and % for the C-shell. Please retain these last characters because it enables users to recognise the shell they are working with from the last character of the prompt.

Please select from the example below the statement requirted and enter it as the last line in your .cshrc file.

for the tcsh shell (user default)
stylestatement required
Your username
gfm>
set prompt="%n> "
Your hostname
scorpio>
set prompt="%m> "
Your username and hostname
This is the DEFAULT for tcsh and will already have been established by the site-wide login files.
gfm@scorpio>
set prompt=" %n@%m> "
for more examples see the man page for tcsh.
Here is an extract from man tcsh about prompt strings .
for the csh shell (alternative shell)
Your username
gfm%
set prompt="$user% "
Your hostname
scorpio%
set prompt="$HOST% "
Your username and hostname
This is the DEFAULT for csh and will already have been established by the site-wide login files.
gfm@scorpio%
set prompt=" $user@$HOST% "
for more examples see the man page for csh.
Here is an extract from man csh about prompt strings .
Sorry no more examples just yet. If you want another example please contact CFG and ask them to update this page (mail to helpdesk@ing.iac.es please).

return to index

Starlink

The Starlink suite of applications is large. If you want Starlink applications to be available to you create a flag file ~/.starlink in your home directory.
Example - to make Starlink utilites available.
user@hostname> touch  ~/.starlink
When you next log in the site-wide login script will see the flag file ~/.starlink and execute the Starlink login and cshrc scripts.

If you don't want Starlink utilites or do not want them anymore then remove the flag file (if it exists)

Example - to remove Starlink utilites.
user@hostname> rm  ~/.starlink
Again this will take effect when you next log in.

The current version of starlink offers the library slalib. The web pages on slalib are just one of the sets of web pages which come with starlink each of which is in a directory with an htx suffix. In each case begin with node1.html in that directory. You do not have to subscribe to starlink to see these pages. If you don't know where to start here is a link to browsing point in Starlink documentation where you will find this list of documentation for STARLINK Software Collection . Another useful page is PGPLOT --- Graphics Subroutine Library

return to index

Modifying the PATH variable

Your PATH variable will have most useful applications in it. If you have chosen to have the Starlink utilities it will also have these.

It should therefore be unnecessary for most users to have to modify the PATH variable. You can examine the value established for you by the site-wide login files by the command

user@hostname> echo $PATH

Appending the ~/bin directory to your PATH variable

If you create your own programs please keep them in the bin subdirectory of your account ie /home/ user /bin (also known as ~ user/ bin or just ~/bin) alternatively create a link to ~/bin from your applications.
Example
user@hostname> mkdir -p ~/bin
user@hostname> cd ~/bin
user@hostname> ln -s /home/user/Cprogs/mickey ~/bin
When you next log in the site-wide login script will see the directory ~/bin and add it to your PATH variable.

Appending the ~/lib directory to your LD_LIBRARY_PATH variable

This is similar to adding ~./bin to the PATH variable. You simply create the directory ~/lib and populate it with files or links. When you next log in the site-wide login script will see the directory ~/lib and add it to your LD_LIBRARY_PATH variable.

Appending the ~/man directory to your MANPATH variable

This is similar to adding ~./bin to the PATH variable. You simply create the directory ~/man and populate it with files or links. When you next log in the site-wide login script will see the directory ~/man and add it to your MANPATH variable.

Prefixing a directory to your PATH variable

In some circumstances you may wish to change the order your search path For example you may have to use a specific version of a product before it has become the offlcial release.
Example
In this fictitious case the site-wide file makes by default version 1 of TheThing program available ( /usr/local/bin/TheThing --> /opt/ScaryfilmsV1/bin/TheThing ) but you want to be testing Version2. A statement such as the following in the ~/.postlogin file could be used to prepend a specific directory item to your PATH variable while leaving the rest intact.
 
setenv PATH "/opt/ScaryfilmsV2/bin:${PATH}"
Now, (after the user logs out and in again!) when the user types
user@host> TheThing
unix searches for the program TheThing in the directories specified by PATH and it will find the new (experimental) version in the directory /opt/ScaryfilmsV2/bin before finding the link in /usr/local/bin to the current version seen by everyone else.
Note

The above example is trivial - a similar result could have been obtained by setting up an alias in the .postcshrc file

alias TheThing /opt/ScaryfilmsV2/bin/TheThing
Now, (after the user invokes another shell or opens another window) when the user types
user@host> TheThing
unix interprets the alias and then has an absolute path reference to the program and does not need to search any list to find it. In either case one or other version can be obtained at any time by invoking the full path name (either /opt/ScaryfilmsV2/bin/TheThing or /opt/ScaryfilmsV1/bin/TheThing)

return to index

Diagnosing PATH variable problems

Please take care when prefixing PATH - if you get it wrong you can end up with a syntax error which leaves PATH entirely undefined. If this happens
  1. disable postlogin file by renaming it from .postlogin to .nopostlogin.
    /usr/bin/mv .postlogin to .nopostlogin
  2. log out and in again
  3. correct the error in the file
  4. enable postlogin file by renaming it from .nopostlogin to .postlogin.
    /usr/bin/mv .nopostlogin .postlogin
  5. log out and in again
In general if CFG are asked to assist with PATH problems it is quite likely they will begin by attempting to reproduce the problem when the customised .postlogin and .postcshrc files have been disabled so you can save a little time by trying this step yourself.

return to index

Overriding the ING default values for tcsh/csh shell variables

The following table lists the items set by the site-wide login script Under the column "file" appears either

pc
the statement should be in .postcshrc
pl
the statement should be in .postlogin
Entries are alphabetically ordered by name column.

namepurposeING default override statementfile
coredumpsize limit size of coredump files
- see man page on limit
0 limit coredumpsize nnn
ulimit coredumpsize
pc
history sets the limit on command recall
- see man page on tcsh
100 set history = nnn pc
ignoreeof cannot use control-D to logout
- see man page on tcsh
set unset ignoreeof pc
umask sets the file mode creation mask
The default 022 removes write access to your files for group and other. This is usually adequate. In some circumstances you may not want group or other to have read access in which case it should be 066. See man page on umask for more details or consult CFG
022 umask nnn pc

Shell variables

For up to date information on the defaults of your shell variables type

user@host> set
To eliminate them use unset. To change value use
user@host> set varname = newvalue
in your .postcshrc file

Environment variables

For up to date information on the defaults of your shell environment variables type

user@host> setenv
To eliminate them use unsetenv. To change value use
user@host> setenv ENVARNAME = newvalue
in your .postlogin file

Aliases

For up to date information on your shell aliases type
user@host> alias
To eliminate them use unalias. To change value use
user@host> alias alias-name definition
in your .postcshrc file

Customising login scripts for a group of users

The Computing Facilities Group can arrange for any set of users to all have the same modifications to their site-wide login files. For example if 6 people (4 software, 1 mechanical and 1 astronomer) all use some project planner software and all need some aliases or environment variables defined so they can all work together this is best done with help from CFG.

Further information on customising login scripts

If you need futher assistance contact the Computing Facilities Group.

return to index