This is the user's guide of the HEPiX Shell Scripts, it tries to describe what a user can do to modify his Shell environment when using the HEPiX Shell Scripts.
This is not an Shell user's guide.
This page is under construction, please be indulgent and send your
comments to Arnaud.Taddei@cern.ch.
This document describes only what is specific to Shells. It is complementary to the %h user's guide.
The user files that you can operate on are described in the files document. In particular, the shell customisation files are summarised in a table and described one by one:
Under the directory $HOME
Moreover, you can specify a preferred group which will provide you the environment of this group.
Note about tcsh:
If you are using tcsh it is recommended that you have a .tcshrc but no .cshrc.
Concerning these 2 files, the behaviour of tcsh is the following:
We will give some examples of tailoring the user environment to personal taste.
Let's assume that you belong to several groups and sometimes you need the environment of one group and in other circumstances you need the environment of another group. In UNIX, there is the notion of primary group and once you logged in, your group id is set to that of the primary group. The HEPiX scripts provide you with a way of specifying the group name from which you want to get the environment using a file $HOME/.hepix/preferred-group. In this file you simply enter the name of the group that you want.
Practical example: I belong to groups c3, c4 and c5. On the system plus1, my primary group is c3 but I want to inherit the environment of group c5. Then, I simply edit the file $HOME/.hepix/preferred-group and I enter c5 in the first line.
Thus, the next time that I login, I will get the environment of group c5.
For instance this mechanism doesn't allow you to specify that you would like to inherit the environment from a group 1 on a service A and from a group 2 on a service A. Thus when you set a preferred group it is set for all the accounts on which you are using this home directory. If for example you have an AFS account and you set a preferred group, then it will be used on all the services on which you are using your AFS Home directory.
There are many different keyboards available on the site. Keyboards are sending signals and unfortunately, as there was no formal standard, it exists some clashes on how to interpret this or that signal. The signal which is sent to erase a character is called the RUBOUT sequence. Some keyboards may send ^? which corresponds to a Delete and some keyboards may send ^H which corresponds to a BackSpace.
Thus the HEPiX shells login scripts provide a environment variable named RUBOUT which you can modify to 2 values : BackSpace or Delete.
you need to create a $HOME/.BackSpace file.
you need to create a $HOME/.Delete file.
In order to get a Backspace from the RUBOUT sequence enter the command:
touch $HOME/.BackSpaceIn order to get a Delete from the RUBOUT sequence enter the command:
touch $HOME/.DeleteIt will then be valid at the next login.
Shell File Example Result =========================================================================== csh .cshrc set prompt='\!>' 24 > tcsh .tcshrc or .cshrc set prompt='\! %~ %#' 24 ~ > ksh .kshrc export PS1='\! >$' 24 > zsh .zshrc export PS1="%S\[%T\]%s"%~ %# " [23:55] ~ > bash .bashrc export PS1='$PWD \! >' /bin 24 >If you want to include the current path in your C-Shell prompt then you have to define the following alias for the cd command.
alias cd chdir \!:\* \; set prompt='$cwd\[!\]\ ' \; setenv CWD '$cwd'
Shell File Example ============================================================================= csh .cshrc alias rs 'set noglob;eval `resize`;unset noglob' tcsh .tcshrc or .cshrc alias H 'history -r | fgrep "{\!*}"' ksh .kshrc alias 'mr=chmod r' zsh .zshrc alias 'rs=eval `resize -u`' bash .bashrc mx() chmod x {$*}
Customising your PATH is a fundamental issue which you should fully understand. Document \citetaddei.dotinpath gives interesting input on this topic especially about the security issues when having a dot (.) in the PATH.
Shell File Example ============================================================================== csh .cshrc set path=( $path $HOME/bin ) tcsh .tcshrc or .cshrc set path=( $path $HOME/bin.$OS ) ksh .profile export PATH="$HOME/bin:$PATH" zsh .zprofile export PATH="$HOME/bin.$OS:$PATH" bash .bash_profile or export PATH="$HOME/bin:$PATH" .profile
Shell File Example ============================================================================== csh .cshrc setenv EDITOR vi tcsh .tcshrc or .cshrc setenv PRINTER ps_rz1 ksh .profile export VISUAL=emacs zsh .zprofile export ORACLE_SID=v712 bash .bash_profile or export PAGER=less .profile
In each newly created account all the templates files for the customisation of the shell are provided. You can edit these files using the examples described in the previous section to customise their environments.
In these templates you will find 3 parts:
if ( -r /usr/local/lib/hepix/central_env.csh ) then source /usr/local/lib/hepix/central_env.csh endifor the following lines for the Bourne-shells users:
if [ -r /usr/local/lib/hepix/central_env.sh ]; then . /usr/local/lib/hepix/central_env.sh fiYou can find something similar to these lines here.
These templates give other examples and, for tcsh or zsh shells, there are other related documents
The uco command is a perl program which you can use to reset your environment in case it has been corrupted or you have made a mistake in customising your environment. This command can be used to reset your shell profiles files, some of your mail default files and some of your security files. Type uco -h to get a quick help.
In addition, this command can help you to set, reset or analyse some of your customisation. It can do it on several areas like the shell, X11, the setting of the keyboard in the context of X Window, the security, the structure of your home directory.
It will present you a menu and you can choose what you want to do. You can set the flags -n to see what the command would do (without actually performing any operations). The -v flag is verbose mode and the command informs you what it is doing.
Of course it saves your files by appending a number in the file name. For example, assume that it is the first time you run uco on the shell area to reset your environment and lets assume that your login shell is tcsh, then you will find .tcshrc.1 and .login.1 files in your HOME directory. If it is the 1000th time you run the command you will find 1000 files in your HOME directory, the last ones being: .tcshrc.1000 and .login.1000
Arnaud Taddei, 8-Jul-1996