#!/bin/csh set UNAME = `uname` if ( -f ~/.cshrc.$UNAME ) source ~/.cshrc.$UNAME goto PATHS_SET MAKEPATH: # accepts: # - add: list of new directories # - list: the current path to change # - ret: the return label foreach d ( $add:q ) # loop to remove all add entries set q = ( ) foreach p ( $list:q ) if ( "$d" != "$p" && -d "$d" ) then set q = ( $q:q "$p" ) endif end set list = ( $q:q ) end # q is now list without any d from add, so foreach d ( $add:q ) if (-d "$d") set list = ( "$d" $list:q ) end goto $ret PATHS_SET: if ( ! $?PATHS_SET ) then set add = ( . ) # architecture specific switch ( "$UNAME" ) case 'SunOS': # add UCB, XPG extended commands etc # to front of path (in reverse order) set add = ( $add:q \ /usr/tibco/tibrv/bin \ /usr/ucb \ /opt/SUNWspro/bin \ /usr/bin \ /usr/xpg4/bin \ /usr/dt/bin \ ) breaksw endsw # now my stuff set add = ( $add:q \ ~ajundzill/usr/*bin/`uname` \ ~ajundzill/usr/*bin \ ~ajundzill/.util/`uname` \ ~ajundzill/.util \ ) set list = ( $path:q ); set ret = RETpath goto MAKEPATH RETpath: set path = ( $list:q ) setenv OPENWINHOME /usr/openwin # now for cdpath if ( ! $?cdpath ) set cdpath set add = ( ~/cvs ~ ) set list = ( $cdpath:q ); set ret = RETcdpath goto MAKEPATH RETcdpath: set cdpath = ( $list:q ) # library path if ( ! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH "" set libpath = `echo $LD_LIBRARY_PATH | tr ':' '\n'` set add = ( \ /opt/SUNWspro/lib \ /usr/dt/lib \ /fidev/apps/iris/shlib \ /usr/tibco/tibrv/lib \ /opt/sybase/OCS-12_5/lib \ /opt/sybase/ASE-12_5/lib \ /usr/openwin/lib \ /usr/local/lib \ /opt/sybase/lib \ ) set list = ( $libpath:q ); set ret = RETlibpath goto MAKEPATH RETlibpath: set libpath = ( $list:q ) # put back colons set p = "" foreach d ( $libpath ) if ( "$p" != "") set p = "${p}:" set p = "$p$d" end setenv LD_LIBRARY_PATH "$p" # and manpath if ( ! $?MANPATH ) setenv MANPATH "" set manpath = `echo $MANPATH | tr ':' '\n'` set add = ( /usr/dt/man /usr/X/man /usr/local/man ~ajundzill/usr/man ) set list = ( $manpath:q ); set ret = RETmanpath goto MAKEPATH RETmanpath: set manpath = ( $list:q ) # put back colons set p = "" foreach d ( $manpath ) if ( "$p" != "") set p = "${p}:" set p = "$p$d" end setenv MANPATH "$p" set PATHS_SET = done endif # PATHS_SET if ( $?DISPLAY && ! $?ORIG_DISPLAY ) then setenv ORIG_DISPLAY "$DISPLAY" endif # now for interactive shells set filec if ( $?prompt ) then set histfile=/dev/null set history=200 unset savehist unalias cwdcmd setenv cdScript ~ajundzill/.util/setcd if ( $shell =~ */tcsh ) set prompt="%B%C04%b " source $cdScript setcd SnC 3 alias h history unalias ps unset ignoreeof if ( { tty -s } ) then # we're starting with a terminal if ( ! $?SHOW_REMINDER ) then if ( -f ~/reminder ) then echo ""; echo ===== Reminder file ~/reminder: ===== cat ~/reminder echo ""; echo ===== Reminder file ~/reminder: ===== | sed -e s/./=/g echo ""; endif setenv SHOW_REMINDER done endif # - try to avoid a DISPLAY with "localhost" in its name if ( ! $?tty ) set tty = `tty | sed -e s./dev/..` if ( $?DISPLAY ) then set display = $DISPLAY if ( { ( echo $display | grep localhost >& /dev/null ) } ) then setenv OLD_DISPLAY "$DISPLAY" unset display endif endif if ( ! $?display ) then # use last to pick up current "terminal" IP address # switch ( `uname` ) # case SunOS: # set nlast = "-n 1 -a" # breaksw # default: # set nlast = "-1 -l" # breaksw # endsw set nlast = "-n 1 -a" # pick up the terminal # take the last word of the first line of last(1) as an IP address set last = `last $nlast $USER | awk '{ print $NF; exit }'` # see if we can find the same thing in who(1) (in comments field) if ( { ( who -uT | grep $tty | grep $last >& /dev/null ) } ) then setenv DISPLAY ${last}:0 set display = $DISPLAY endif endif endif endif # and X? if ( $?DISPLAY ) then if ( $?prompt && ! $?XEDITOR ) echo Display: setenv DISPLAY ${DISPLAY} # do we support CDE? if ( -d ~/.dt && -d /usr/dt/bin ) then if ( ! $?DTSCREENSAVERLIST ) \ setenv DTSCREENSAVERLIST `echo StartDtscreenSwarm \ StartDtscreenQix \ StartDtscreenFlame \ StartDtscreenHop \ StartDtscreenImage \ StartDtscreenLife \ StartDtscreenRotor \ StartDtscreenPyro \ StartDtscreenWorm \ StartDtscreenBlank` # if ( ! $?dtstart_sessionlogfile ) \ # setenv dtstart_sessionlogfile /dev/null # if ( ! $?XMBINDDIR ) \ # setenv XMBINDDIR /usr/dt/lib/bindings if ( ! $?DTUSERSESSION ) \ setenv DTUSERSESSION \ ${USER}-`echo $DISPLAY | sed -e s/:/-/ | sed -e s/\\.0\$//` # if ( ! $?DTDATABASESEARCHPATH ) \ # setenv DTDATABASESEARCHPATH `echo ~/.dt/types \ # /usr/dt/appconfig/types/%L \ # /usr/dt/appconfig/types/C | \ # tr ' ' ,` # # setenv DTXSERVERLOCATION remote # if ( ! $?XFILESEARCHPATH ) \ # setenv XFILESEARCHPATH `echo /usr/openwin/lib/locale/%L/%T/%N%S \ # /usr/openwin/lib/%T/%N%S | \ # tr ' ' :` # if ( ! $?XMICONSEARCHPATH ) \ # setenv XMICONSEARCHPATH `echo ~/.dt/icons/%B%M.pm \ # ~/.dt/icons/%B%M.bm \ # ~/.dt/icons/%B \ # /usr/dt/appconfig/icons/%L/%B%M.pm \ # /usr/dt/appconfig/icons/%L/%B%M.bm \ # /usr/dt/appconfig/icons/%L/%B \ # /usr/dt/appconfig/icons/C/%B%M.pm \ # /usr/dt/appconfig/icons/C/%B%M.bm \ # /usr/dt/appconfig/icons/C/%B | \ # tr ' ' :` # if ( ! $?XMICONBMSEARCHPATH ) \ # setenv XMICONBMSEARCHPATH `echo ~/.dt/icons/%B%M.bm \ # ~/.dt/icons/%B%M.pm \ # ~/.dt/icons/%B \ # /usr/dt/appconfig/icons/%L/%B%M.bm \ # /usr/dt/appconfig/icons/%L/%B%M.pm \ # /usr/dt/appconfig/icons/%L/%B \ # /usr/dt/appconfig/icons/C/%B%M.bm \ # /usr/dt/appconfig/icons/C/%B%M.pm \ # /usr/dt/appconfig/icons/C/%B | \ # tr ' ' :` # if ( ! $?DTSOURCEPROFILE ) setenv DTSOURCEPROFILE true # if ( ! $?DTHELPSEARCHPATH ) \ # setenv DTHELPSEARCHPATH \ # `echo ~/.dt/help/$DTUSERSESSION/%H \ # ~/.dt/help/$DTUSERSESSION/%H.sdl \ # ~/.dt/help/$DTUSERSESSION/%H.hv \ # ~/.dt/help/%H \ # ~/.dt/help/%H.sdl \ # ~/.dt/help/%H.hv \ # /usr/dt/appconfig/help/%L/%H \ # /usr/dt/appconfig/help/%L/%H.sdl \ # /usr/dt/appconfig/help/%L/%H.hv \ # /usr/dt/appconfig/help/C/%H \ # /usr/dt/appconfig/help/C/%H.sdl \ # /usr/dt/appconfig/help/C/%H.hv | \ # tr ' ' :` if ( ! $?DTAPPSEARCHPATH ) \ setenv DTAPPSEARCHPATH `echo /home/ajundzill/.dt/appmanager \ /usr/dt/appconfig/appmanager/%L \ /usr/dt/appconfig/appmanager/C | \ tr ' ' :` if ( ! $?TERMINAL_EMULATOR ) setenv TERMINAL_EMULATOR xterm endif # use NEdit setenv XEDITOR "nc -noask" if ( -d ~/.app-defaults ) then set app_defaults = ~/.app-defaults setenv XAPPLRESDIR $app_defaults set app_defaults = $app_defaults/%N if ( $?XUSERFILESEARCHPATH ) then switch ( :${XUSERFILESEARCHPATH}: ) case *:${app_defaults}:* : # echo not Resetting XUSERFILESEARCHPATH breaksw default: # echo Resetting XUSERFILESEARCHPATH setenv XUSERFILESEARCHPATH ${XUSERFILESEARCHPATH}:$app_defaults breaksw endsw else setenv XUSERFILESEARCHPATH $app_defaults endif endif endif # now for interactive shells (again) if ( $?prompt ) then if ( -r ~ajundzill/.util/aliasrc) then source ~ajundzill/.util/aliasrc endif endif