source: trunk/packs/dotfiles/cshrc @ 19148

Revision 19148, 9.0 KB checked in by ghudson, 22 years ago (diff)
Put /usr/athena/lib in default LD_LIBRARY_PATH.
  • Property svn:executable set to *
Line 
1# Global cshrc file
2#
3# $Id: cshrc,v 1.3 2003-04-02 15:36:51 ghudson Exp $
4
5# This file is sourced by default user file ~/.cshrc
6
7
8set initdir=/usr/athena/lib/init
9
10# *******************   ENVIRONMENT SETUP   *******************
11
12# Compatibility with older versions of Athena tcsh
13set autolist=""
14if ($?tcsh) then
15  bindkey "^W" backward-delete-word
16  bindkey "^Z" complete-word
17  bindkey " " magic-space
18
19  if ($tcsh:r:e > 7 || $tcsh:r:r > 6) then
20    alias bind 'echo The \"bind\" command is no longer supported in tcsh 6.08. Use the; echo \"bindkey\" command instead. See the tcsh man page for more information.; ( echo \!* > /dev/null )'
21  endif
22endif
23
24# Set up standard system/user environment configuration (including setup of
25# environment variables, attachment of lockers, and setting of search path)
26
27if (! $?ENV_SET) then
28
29  setenv ENV_SET                                # Avoid unnecessary repeat
30  setenv HOSTTYPE "`/bin/athena/machtype`"
31  setenv HOST "`hostname`"
32  set hosttype=$HOSTTYPE
33  set host=$HOST
34
35  umask 077                             # Strictly protect files
36                                        #  (does not apply in AFS)
37  limit coredumpsize 0                  # Don't allow coredumps
38  setenv MORE -s                        # Default "more" behavior
39                                        # we are now down to -s
40                                        # because -d is wrong.
41  setenv EDITOR emacs                   # Set default editor
42  setenv VISUAL emacs                   # Set default screen editor
43  setenv MM_CHARSET iso-8859-1
44
45  # Set standard Athena path variables.  Actual $path (and thus $PATH)
46  # are set later, after ~/.environment is sourced.
47
48  switch ("$HOSTTYPE")
49  case sun4:
50    set athena_path=( /srvd/patch /usr/athena/bin /usr/athena/etc /bin/athena \
51                      /usr/openwin/bin /usr/openwin/demo /usr/bin \
52                      /usr/ccs/bin /usr/sbin /sbin /usr/ucb )
53    set athena_manpath=/usr/athena/man:/usr/openwin/man:/usr/dt/man:/usr/man
54    breaksw
55  case linux:
56    set athena_path=( /usr/athena/bin /usr/athena/etc /bin/athena /usr/bin \
57                      /bin /usr/X11R6/bin /usr/sbin /sbin )
58    set athena_manpath=/usr/athena/man:/usr/share/man:/usr/X11R6/man
59    breaksw
60  default:
61    echo "Standard dotfiles do not support system type $HOSTTYPE."
62    breaksw
63  endsw
64
65  setenv MANPATH "$athena_manpath"
66
67  # Set other miscellaneous OS-specific environment variables
68  switch ("$HOSTTYPE")
69  case sun4:
70    setenv LD_LIBRARY_PATH /usr/athena/lib:/usr/openwin/lib
71    setenv OPENWINHOME /usr/openwin
72    breaksw
73  case linux:
74    setenv LD_LIBRARY_PATH /usr/athena/lib
75    breaksw
76  endsw
77
78  setenv ATHENA_SYS `/bin/athena/machtype -S`
79  if ( $ATHENA_SYS == "" ) then
80    setenv ATHENA_SYS @sys
81  endif
82  setenv ATHENA_SYS_COMPAT `/bin/athena/machtype -C`
83
84  set bindir=arch/${ATHENA_SYS}/bin
85
86  if ( ! $?PRINTER && -e /var/athena/clusterinfo ) then
87    setenv PRINTER `awk '/LPR/ { print $3 }' /var/athena/clusterinfo`
88    if ( $PRINTER == "" ) unsetenv PRINTER
89  endif
90
91  # Reset the "home" and HOME variables to correspond to the actual
92  # location of the user's home directory.  This will avoid having
93  # long pathnames being printed when /mit/<user> is a symlink to a
94  # path within AFS.
95  #
96  # This code has been optimized to run as quickly as possible.  Since
97  # it is being invoked only at the beginning of the session, and
98  # prior to the inclusion of any of the user's other dotfiles, we can
99  # assume that the current directory is the user's home directory.
100  # Also, to avoid having the shell re-evaluate the current contents
101  # of the directory, we help it by resetting its "cwd" variable.  We
102  # do error checking just in case the path somehow disappears.
103
104  set x=`/bin/pwd`
105  if ("$x" != "") then
106    set home=$x cwd=$x
107  endif
108  unset x
109
110  # Special version of add alias that will work in your ~/.environment
111  # file.  This is replaced further down with the version that works
112  # when you are logged in.
113
114  # This "extend" alias and friends have been left in for backwards
115  # compatibility with old .environment files, just in case. The new
116  # add alias does not use them.
117  alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
118  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
119  if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
120  unset extendyes'
121  alias sextend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
122  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
123  if ($?extendyes) set \!:1=(${\!:1} \!:2) && \\
124  unset extendyes'
125  alias textend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
126  if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
127  if ($?extendyes) set \!:1=${\!:1}:\!:2 && \\
128  unset extendyes'
129
130  alias add 'eval `/bin/athena/attach -Padd -P "$athena_path" \!:*`'
131
132  # Run user environment customizations identified in your
133  # ~/.environment file.  This is the place to include your own
134  # environment variables, attach commands, and other system wide
135  # setup commands.  You can also cancel default behaviors listed
136  # above with "unsetenv" or "setenv".  ~/.environment is not sourced
137  # if NOCALLS is set (i.e., if you selected the xlogin "Ignore your
138  # customizations" option when you logged in).
139
140  if ((! $?NOCALLS) && (-r ~/.environment)) source ~/.environment
141       
142  # remove temporary version of add
143  unalias extend sextend textend add
144  alias add 'echo Use add in your ~/.environment, not your ~/.path.'
145
146  # Reset athena_manpath in case .path uses it (.path should just use
147  # $MANPATH, but using $athena_manpath has worked historically).
148  set athena_manpath=$MANPATH
149
150  # Set up default search path, if not yet set.  Use your ~/.path file
151  # to provide an alternative path -- this file should be of the form
152  # "set path=...", and can refer to the shell variable $athena_path,
153  # defined above. The ~/.path file should list a complete path, since
154  # the path identified there will be used INSTEAD of the default
155  # path, not appended.  ~/.path is not sourced if the xlogin "Ignore
156  # your customizations" option was selected to begin the session.
157
158  if ((! $?NOCALLS) && (-r ~/.path)) then
159    # User-specified path
160    source ~/.path
161  else
162    # Standard Athena path
163    set path=(`/usr/athena/bin/athdir $HOME` $athena_path .)
164  endif
165
166  # Make sure applications can properly find their appdefs, etc.
167
168  if (! $?XUSERFILESEARCHPATH) then
169    setenv XUSERFILESEARCHPATH "/usr/athena/lib/X11/app-defaults/%N"
170  else
171    setenv XUSERFILESEARCHPATH "${XUSERFILESEARCHPATH}:/usr/athena/lib/X11/app-defaults/%N"
172  endif
173endif
174
175# Set appropriate bin directory variable for this platform
176# (e.g., vaxbin for VAXstations, decmipsbin for pMAXen, etc.;  this will
177# be included in actual searchpath as ~/$bindir -- e.g., ~/vaxbin):
178set bindir=arch/${ATHENA_SYS}/bin
179
180# *******************  C SHELL SETUP   *******************
181
182# Set up standard C shell initializations
183
184set noclobber                   # Don't overwrite files with redirection
185
186if ($?prompt) then              # For interactive shells only (i.e., NOT rsh):
187  # Set prompt.
188  set promptchars="%#"
189  if ($home =~ /var/athena/tmphomedir/*) then
190    set prompt = "athena (temporary homedir)%# "
191  else
192    set prompt = "athena%# "
193  endif
194
195  set history = 20              #   Number of commands saved as history
196  set cdpath = (~)              #   Path to search for directory changes
197  set interactive               #   Provide shell variable for compatability
198  set nostat = (/afs/)          #   Don't stat when completing in /afs
199endif
200
201set hosttype=$HOSTTYPE
202set host=$HOST
203
204# Set up standard C shell aliases
205
206#   alias for re-establishing authentication
207alias renew 'kinit $USER && fsid -a && zctl load /dev/null'
208
209#   alias for a convenient way to change terminal type
210alias term 'set noglob; unsetenv TERMCAP; eval `tset -s -I -Q \!*`'
211
212#   aliases dealing with x window system
213alias xresize 'set noglob; eval `resize -c` || unset noglob'
214
215if ($?XSESSION) then
216  if ("$XSESSION" == "") then
217    alias logout        'exit && end_session'           # logout for X
218  else
219    alias logout        'exit && kill -HUP $XSESSION'   # logout for X
220  endif
221endif
222
223#   aliases dealing with adding locker programs
224#   extend remains for other software; add no longer uses the extend alias
225alias extend 'if (-d \!:2) if ("$\!:1" \!~ *"\!:2"*) set extendyes && \\
226        if ($?extendyes && $?verboseadd) echo \!:2 added to end of \$\!:1 && \\
227        if ($?extendyes) setenv \!:1 ${\!:1}:\!:2 && \\
228        unset extendyes'
229
230set add_flags
231alias add 'eval `/bin/athena/attach -Padd $add_flags \!:*`'
232
233#   aliases dealing with subjects
234alias setup_X '( setenv SUBJECT \!:1 ; ( xterm -title \!* & ) )'
235alias setup_tty '( setenv SUBJECT \!* ; $SHELL )'
236if ($?XSESSION) then
237  alias setup setup_X
238else
239  alias setup setup_tty
240endif
241alias remove 'setenv SUBJECT \!* ; source $initdir/env_remove'
242
243# If this is a subject window, run the env_setup script
244if (($?SUBJECT) && (-r $initdir/env_setup)) source $initdir/env_setup
245
246
247# All of the C shell initializing commands above can be overridden by
248# using "unset" or "unalias" commands (or by changing things using
249# "set" or "alias" again) in your ~/.cshrc.mine file, which is sourced
250# here.  ~/.cshrc.mine is not sourced if the xlogin "Ignore your
251# customizations" option was selected to begin the session.
252
253if ((! $?NOCALLS) && (-r ~/.cshrc.mine)) source ~/.cshrc.mine
Note: See TracBrowser for help on using the repository browser.