# Generic .profile for CL users # # This file is intended to work with the following shells # bash ksh msh sh # # If you customise this file then please modify the first line or delete # all the comments at the head of this file to avoid confusion if you have # problems and ask for help. # # This file is commented to allow you to easily tailor your own environment. # However, it should also provide sufficient functionality for those who do # not wish to do so. # Work out what sort of machine we are on ARCH=`arch` # The umask value is set so that only the owner has write permission on # files created. (If you work in "group" directories you may need to # set this to 0002 to give access by default to other members of the # group.) umask 0022 # Some shell variables need to be set to make life more convenient # CDPATH is searched when you issue a cd command -- if you give a relative # path as an argument (this may not work on some antique versions of sh). CDPATH=.:$HOME # A number of applications use the EDITOR -- set this to your personal choice. EDITOR=gnuemacs # PRINTER should be set to the printer you want to use by default. # suitable names and their locations may be found with the "lpq -list" command PRINTER=elm # The PATH needs to be set up correctly to ensure that commands are found # This is different between systems. The standard path should be # augmented to add /usr/bin/X11 and /usr/bin/mh. The others should # have been set already. case $PATH in *:/usr/bin/X11:*|/usr/bin/X11:*|*:/usr/bin/X11) ;; *) PATH=$PATH:/usr/bin/X11 ;; esac case $PATH in *:/usr/bin/mh:*|/usr/bin/mh:*|*:/usr/bin/mh) ;; *) PATH=$PATH:/usr/bin/mh ;; esac # Finally add the current directory at the end PATH=$PATH:. # If you login over a network from a old style terminal then # the system will need to figure out what you are using. if [ -r /usr/bin/ttytype ] then case $TERM in ""|dumb|su|network|unknown) TERM="" TERM=`ttytype` if [ -z "$TERM" ] then echo "TERM value not set!" fi ;; *) ;; esac fi # The way certain characters are handled by the system are different between # Unixes. case $ARCH in sun*) stty crt erase \^? kill \^x intr \^c ;; *) stty erase \^? kill \^x intr \^c echoe susp \^z ;; esac # Work out the name of the host we are on a a short form of the name LHOST=`uname -n` SHOST=`expr $LHOST : '\([^.]*\)'` # The history mechanism used by the Shell needs to be tailored. # This section also sets up the tailor file for non-login shells # such as are run when a script is run or a process exec's a shell. # If you want a file per machine then create the directory $HOME/.h. case $SHELL in */ksh|*/bash|*/msh) if [ -d $HOME/.h ] ; then HISTFILE=$HOME/.h/$SHOST else HISTFILE=$HOME/.sh_history fi export HISTFILE;; *) ;; esac case $SHELL in */ksh) HISTSIZE=50 VISUAL=emacs export HISTSIZE VISUAL ;; */bash) HISTSIZE=50 # Add shell functions to .bashrc file if [ -f $HOME/.bashrc ]; then source ~/.bashrc; fi export HISTSIZE ;; */msh) HISTORY=50 # Any shell functions you write should be put into the file called below. if [ -f $HOME/.msh_profile ] then SHINIT='. $HOME/.msh_profile' ; export SHINIT fi export HISTORY ;; *) ;; esac # Now set the prompt in a nice way depending on what sort of window you are # at and where you have logged in from. case $SHELL in */sh) # No shell functions so give up now export CDPATH EDITOR PRINTER TERM PATH exit ;; *) ;; esac case $SHELL in /*msh) # have shell functions so use one here if [ -n "$DISPLAY" ] then # Define the shell function to trap cd calls and set the working directory # in the title bar of a xterm -- this may not work with some temrinal # emulators! cd () { builtin cd $* echo -n "\0033]0;$SHOST:`pwd`\0007" } PS1="$ " cd else PS1="$SHOST:\d$ " fi ;; */bash) PS1="$SHOST:\W$ " ;; *) PS1="$SHOST$ " ;; esac export CDPATH EDITOR PRINTER TERM PATH