# /usr/local/etc/profile #set -x H=$HOME CB=/usr/contrib/bin ECHO="/bin/echo" #Use an echo which understands \c, \t, etc! STTY=/bin/stty export HOME H CB # echo $COMD/profile # Create a PATH. We assume that /etc/profile has passed us a PATH already # containing the main system executable areas. We will simply add to this. # Add my own bin directory at the very front. # Prefix MY bin area and other convenient locals (demo, etc) to the front, # if not done yet: # echo "$COMD/profile: \$0=$0, initial path=$PATH" # ID=`id|tr ')' '('|cut -d '(' -f2` ID=$USER case $ID in *root) # Strictly speaking, shouldn't have "." for root, but not having it # is a damn nuisance - include it: PATH=".:${PATH}:/etc:/usr/local/etc" ;; *) PATH=".:${PATH}" export PATH ;; esac #echo "$COMD/profile: path now =$PATH" #----------------- SHELL ------------------------ # # Work out what shell we are. This can sometimes be a bit tricky. For "su", # we have to get the shell name from the passwd file. If null, as is allowed, # it defaults to /bin/sh # # echo "here we go - \$0=$0" case $0 in *bash) SHELL=bash ;; *ksh) SHELL=ksh ;; *sh) SHELL=sh ;; *su) # If su to root, must do syntax tests. For the # present, just assume shell must be bash, ksh or sh # (I don't think csh reads this anyway): if [ -n $BASH ] then SHELL=bash else alias s=s 2> /dev/null if [ $? = 0 ] then SHELL=ksh else SHELL=sh fi fi ;; esac export SHELL # Set up useful prompts: #case $ID in # *root) # PROMPT='#' # MARK="-$ID" # ;; # *) # PROMPT='%' # MARK= # ;; #esac if [ "$ID" = "$LOGNAME" ] then PROMPT='%' MARK= else PROMPT='#' MARK="-$ID" fi case $SHELL in *bash) if [ -n "$FULL_PROMPT_PATH" ] then PS1="${HOSTNAME}$MARK:<\w> $PROMPT " else PS1="${HOSTNAME}$MARK:<\W> $PROMPT " fi ;; *) if [ -n "$FULL_PROMPT_PATH" ] then PS1="${HOSTNAME}$MARK <\w> ($SHELL) $PROMPT " else PS1="${HOSTNAME}$MARK <\W> ($SHELL) $PROMPT " fi ;; esac #-------------- ENVIRONMENT ---------------------------- # # Pick up any useful functions I might use # for file in /usr/local/etc/func[1-9].sh do if [ -f $file ] then . $file fi done for file in $HOME/bin/func[1-9].sh do if [ -f $file ] then . $file fi done #-------------- DISPLAY ---------------------------- # # LINE is set in /etc/profile - it should be the name of the machine at # which the user is physically located, so use this to set DISPLAY: # echo DISPLAY=$DISPLAY #if [ -z "$DISPLAY" ] #then # DISPLAY=${LINE}:0.0 #fi #echo DISPLAY now=$DISPLAY export DISPLAY # # Collect yesterdays CDPATH # # DIRS=$HOME/.dirs # if [ -f $DIRS ] # then # CDPATH=`cat -v $DIRS` # else # CDPATH=".:..:$HOME:/" # fi CDPATH=".:..:../..:../../..:../../../.." export CDPATH ## Once per day, update CDPATH file (in bk-gnd). Use a temp file to ## avoid collisions. AVOID for users like root, news (takes too long): # #case $ID in # root|news) # ;; # *) # if daily -n # then # # echo "Trying to build new $DIRS" # ( rm -f $DIRS.$$ # $ECHO ".:..:../..:../../..:\c" > $DIRS.$$ # if [ "$HOME" != "/" ] # then # cdgen $HOME >> $DIRS.$$ # fi # rm -f $DIRS # mv $DIRS.$$ $DIRS ) & # fi # ;; #esac # We often get core files in the home directory. Clobber them rm -f $HOME/core # Set MACDIR to point at current Sw/Supp Dept troff macros: MACDIR="/var/u/doco/sw/unix/hints/troff/macs" export MACDIR # a few alias's: case $SHELL in *ksh | *bash ) # allow multi-line commands to be recalled as a block: command_oriented_history=y complete=y complete_variable=y # set -o vi # prevent filename completion (via TAB) from seeing .o, .i or .p files: FIGNORE='.o:.p:.i:.e:.h' # few aliases: # alias wh="$TB/wh" alias ll='/bin/ls -lF $*' alias la='/bin/ls -laF $*' alias l="less -qM" case $OSV in irix*|hpux) # Use std man: alias man='/bin/man' ;; solaris|sunos) alias ll='/usr/5bin/ls -lF $*' alias la='/usr/5bin/ls -laF $*' alias man='/usr/contrib/bin/man' ;; *) : ;; esac case $OSV in irix*) # LM_LICENSE_FILE="${LM_LICENSE_FILE}:/usr/licenses/octane_float_0367.14.1.970:/usr/licenses/timestamp_909133780" # LICENSEMGR_NO_GUI=' ' # LICENSEMGR_DEBUG=' ' BIOSYM_ROOT=/usr BIOSYM_CONTEXT=msi BIOSYM=/usr/msi BIOSYM_PLATFORM=irix6r8 BIOSYM_LIBRARY=/usr/msi/biosym_lib/ DELPHIDATA=/usr/msi/data/delphi RESIDUE_LIBRARY=cvffa.rlb INSIGHT_POTENTIAL_TEMPLATES=cvff_templates.dat FORCEFIELD=cvff.frc LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/msi/irix6r8/biosymso" export LM_LICENSE_FILE BIOSYM_ROOT BIOSYM_CONTEXT BIOSYM BIOSYM_PLATFORM BIOSYM_LIBRARY DELPHIDATA RESIDUE_LIBRARY INSIGHT_POTENTIAL_TEMPLATES FORCEFIELD LD_LIBRARY_PATH LICENSEMGR_NO_GUI LICENSEMGR_DEBUG ;; esac alias lll='ll | l' alias lt='ll -t' alias q=pwd alias e=echo alias p='page' alias cd-='cd ~-' alias cd/-='cd /' alias cd..='cd ..' alias a=alias alias f="typeset -f" # show defined functions alias x="chmod 777" alias stopnn='/usr/local/lib/newsbin/input/newsrunning off; /usr/local/lib/newsbin/input/newsrunning' alias startnn='/usr/local/lib/newsbin/input/newsrunning on; /usr/local/lib/newsbin/input/newsrunning' alias pss='ps -elf | l' alias pssw='ps -elf | l' alias psf='ps -elf | l' alias psfw='ps -elf | l' alias show='ps -ef|grep' alias root='su troot' case $OSV in solaris) alias du='du -k ' alias df='df -k' alias top='top -SI' alias nedit="textedit -bg pink" ;; linux*) alias ow=startx alias pss='ps aufxww|l' alias show='ps auxww|grep' ;; irix*) alias du='du -k ' alias df='df -k' alias top='/usr/sbin/top' ;; sunos) alias pss='ps -agxu | l' alias pssw='ps -agxuw | l' alias psf='ps -agxl | l' alias psfw='ps -agxlw | l' alias show='ps -augwx|grep' alias restartp='/usr/local/sys/restart-lpd' alias top='top -SI' ;; esac alias c=cat alias v='vi -R' alias mtr='mt -f /dev/nrst1 rew' alias dumpdir='cd /usr/local/adm/dumpdir/labels' alias rmgp='/usr/local/lib/newsbin/maint/delgroup' alias adgp='/usr/local/lib/newsbin/maint/addgroup' alias newsd='/var/spool/news' alias untar='tar xf ' alias lo=exit alias clayton='telnet loyth.minerals.csiro.au' alias loyth=clayton alias path='echo $PATH' alias term='echo $TERM' alias 24='$STTY rows 24; TERM=vt102' alias 35='$STTY rows 35; TERM=xterm' alias 40='$STTY rows 40; TERM=xterm' alias 48='$STTY rows 48; TERM=xterm' alias webdir='cd /var/spool/www/htdocs/comp' alias sysdir='cd /usr/local/sys' alias cbdir='cd /usr/contrib/bin' alias newsdir='cd /usr/local/lib/news' alias dnsdir='cd /usr/local/etc/domain' alias nspool='cd /var/spool/news' alias mspool='cd /var/spool/mail' alias bdir='cd /usr26/%backups' alias cm='cd /usr/local/lib/mail' alias enable='/bin/enable' alias disable='/bin/disable' alias monprt='tail -f /var/lp/logs/lpNet' alias lsd="/bin/ls -l|grep '^d'|tr -s ' ' |cut -d ' ' -f9" alias yp="ypcat passwd | grep -i " alias colours="l /usr/openwin/lib/X11/rgb.txt" alias psycho="/usr/biosym/230/gifts/insight/BCL_230/psycho" alias c2="/usr/local/msi/cerius2_3.5/bin/cerius2" alias lachlan="telnet sv1.ccp14.ac.uk" ;; esac #if daily -n #then # cat $MOTD #fi # Lastly, update the daily default logfile (should be used as "daily -n" # prior to this point): daily # End of "common" profile for sh/ksh/bash.