# .cshrc - *csh startup file # Steve Kinzler, kinzler@cs.indiana.edu, Apr 96/May 00 # http://www.cs.indiana.edu/~kinzler/home.html#unixcfg # Append to /{,root/}.{,t}cshrc, ~oracle/.cshrc # if necessary (eg probably if suhow = su); # "$CSH_ENVIRON != $USER" clause may need to be excluded: # # if ( $?CSH_ENVIRON ) then # if ( ~$CSH_ENVIRON != '/' && ~$CSH_ENVIRON != '/root' && \ # $CSH_ENVIRON != $USER && -r ~$CSH_ENVIRON/.cshrc ) then # source ~$CSH_ENVIRON/.cshrc # endif # endif # Fix /etc/*cshrc* if necessary -- see below tg1. umask 022 if ( ! $?USER ) then setenv USER "$LOGNAME" endif set suhow = sudo if ( $?HOST ) then # palmpre if ( "$HOST" =~ dkinzler* || "$HOST" =~ castle* || \ "$HOST" =~ swank* || "$HOST" =~ transit* || \ "$HOST" =~ web2* || "$HOST" =~ trendy* ) set suhow = su # transit/trendy's sudo doesn't support -E, so stick with su endif if ( -o /bin/su || -o /usr/bin/su || -o /u/oracle/oracle ) then set su if ( $?CSH_ENVIRON ) then set user = $CSH_ENVIRON endif set home = ~$USER unsetenv BASEPATH PATHPLUS else setenv CSH_ENVIRON $USER endif if ( ! $?ARCHIT ) then setenv ARCHIT `~/binp/archit` endif #alias +abat 'if ( -r ~/l/abat/.cshrc ) source ~/l/abat/.cshrc' alias +apache 'set path = ( $path /l/apache/bin )' alias +besteval 'if ( -r ~besteval/etc/cshrc ) source ~besteval/etc/cshrc' alias +cope 'set path = ( /usr/local/cope $path )' alias +cseval 'if ( -r ~cseval/etc/cshrc ) source ~cseval/etc/cshrc' alias +cssurv 'if ( -r ~cssurv/etc/cshrc ) source ~cssurv/etc/cshrc' #alias +dumps 'set path = ( $path /usr/local/ws/qr/{bin,etc} ~dumps/bin )' #alias +elmira 'if ( -r ~/l/elmira/.cshrc ) source ~/l/elmira/.cshrc' alias +fun 'set path = ( $path ~/l/fun/bin ~/l/fun/bin/$ARCHIT )' alias +games 'set path = ( $path /usr/local/games /usr/games )' alias +hra 'if ( -r /l/web/hra/etc/cshrc ) source /l/web/hra/etc/cshrc' alias +hyplan 'set path = ( $path ~/.hyplan/bin )' alias +iueval 'if ( -r ~iueval/etc/cshrc ) source ~iueval/etc/cshrc' # see http://www.cs.indiana.edu/csg/software/SunJDK.html alias +java 'set path = ( /usr/java/default/bin /l/jdk/bin $path )' alias +kde 'set path = ( $path /opt/kde/bin )' alias +oracle 'set path = ( $path ~oracle/bin )' alias +palm 'set path = ( $path /l/palm/bin )' alias +perl 'set path = ( $path /l/perl/bin )' alias +picons 'set path = ( /l/picons/bits /l/netpbm/bin $path' \ '/l/picons/{bin,apps} /l/aicons/support/scripts )' #alias +sunpro 'set path = ( /opt/SUNWspro/bin $path )' alias +web 'set path = ( $path /l/web/bin )' alias +zxid 'set path = ( $path /usr/local/zxid/current/bin )' alias +reset 'set path = ( ~/binp $BASEPATH )' if ( ! $?BASEPATH ) then set basepath = ( ~/bin ~/bin/$ARCHIT /usr/site/bin \ /usr/local/bin /opt/bin /usr/{ucb,bsd} /bin /usr/bin \ /usr/um/bin /usr/itd/bin /usr/vice/bin \ /usr/local/bin/X11 /usr/bin/X11 \ /usr/openwin/bin /l/X11R6/bin /usr/X11R5/bin \ /usr/local/adm/bin /usr/local/sbin /opt/sbin /sbin /usr/sbin \ /usr/local/etc /etc /usr/etc \ /usr/ccs/bin /usr/5bin /usr/contrib/bin \ /usr/compat/linux/bin /usr/compat/linux/usr/bin \ /usr/compat/linux/sbin /usr/{local,um}/gnu/bin ) # /usr/hosts ) setenv BASEPATH "$basepath" +reset endif #tg1 Did a (Linux) system cshrc reset our PATH? *Sigh*, it shouldn't touch it. if ( $#path < 25 ) then # Gentoo's tcsh doesn't like this on one line. +reset # This is a kludge, additions are lost. endif # Optional convenience kludge. Shouldn't trigger any NFS mounts. if ( $?BACKPATH && ! $?PATHPLUS ) then if ( $?HOST ) then if ( "$HOST" =~ *moose* ) then +picons; +oracle endif if ( "$HOST" =~ alembic* || "$HOST" =~ swank* ) then +hra; +perl; +games; +picons; +palm endif if ( "$HOST" =~ alamo* ) then +hra; +perl endif if ( "$HOST" =~ *ahm*.com.au ) then +hra endif if ( "$HOST" =~ [dp]kinzler* ) then +picons; +palm endif if ( "$HOST" =~ ukinzler* ) then +games; +picons endif endif setenv PATHPLUS endif if ( $?prompt ) then if ( $?su ) then setenv EXINIT "so ~/.exrc" if ( ! $?alias_so ) then # `suspend` with su here doesn't work on Ubuntu 9.10; # this work-around yields doubled prompts :-( # 2011-02-02 now doesn't work on alembic/alamode either # 2011-03-16 now doesn't work on trendy either if ( $suhow == su && $?HOST ) then if ( "$HOST" =~ ukinzler* || \ "$HOST" =~ aludel* || \ "$HOST" =~ hm-* || \ "$HOST" =~ alembic* || \ "$HOST" =~ alamode* || \ "$HOST" =~ trendy*) then alias suspend 'kill -STOP $$' endif endif alias s 'mesg y; o' alias o 'alias s suspend; alias o suspend; suspend' set alias_so endif else alias S 'su root -c "exec $shell"' if ( $suhow == sudo ) alias S 'sudo -E "$shell"' if ( $ARCHIT == sun4elf ) then alias O 'su oracle -c "exec $shell"' else alias O 'su oracle --session-command "exec $shell"' endif if ( ! $?alias_so ) then alias s 'alias s %"'"'su root'"'"; S' if ( $suhow == sudo ) then alias s 'alias s %"'"'sudo -E'"'"; S' endif alias o 'alias o %"'"'su oracle'"'"; O' set alias_so if ( $?HOST ) then if ( "$HOST" =~ *.cs.indiana.edu ) alias s o endif endif endif set filec history = ( 1024 '%h\t%Y/%W/%D %P\t%R\n' ) notify unset autologout alias helpcommand cmdhelp # use with caution alias lo 'source ~/etc/lo; exit' alias resize 'set noglob; eval `\resize`; unset noglob' alias x 'stty dsusp undef >& /dev/null; stty susp undef; \x \!*; lo' alias fixbs 'setenv ERASE ^H; stty erase "$ERASE"; so' alias fixdel 'setenv ERASE ^\?; stty erase "$ERASE"; so' if ( $?tcsh ) then setenv VSHNUTMP /tmp alias V 'alias precmd "source ~/etc/precmd"; $VSH "$cwd"' if ( ! $?alias_v ) then alias v V alias vv 'h; V' set alias_v endif if ( $?ERASE ) then if ( "$ERASE" == ^H ) then bindkey ^H backward-delete-char bindkey ^? backward-char else bindkey ^H backward-char bindkey ^? backward-delete-char endif endif bindkey ^B backward-word bindkey ^D delete-word bindkey ^F forward-word bindkey ^G backward-char bindkey ^L clear-screen bindkey ^U keyboard-quit bindkey ^W backward-delete-word bindkey ^X delete-char-or-list bindkey ^] forward-char bindkey ^[^I complete-word-raw bindkey ^[^X list-choices-raw bindkey ^[^] tty-dsusp bindkey ^[* list-glob bindkey ^[a beginning-of-line bindkey ^[c normalize-command bindkey ^[g expand-glob bindkey ^[k kill-region bindkey ^[n normalize-path bindkey ^[v expand-variables bindkey ^[x exchange-point-and-mark bindkey "^[[3~" backward-char # To set some unused ^[A-Z's to their corresponding # control keys for Kindle keyboards: bindkey ^[E end-of-line bindkey ^[G backward-char bindkey ^[I complete-word bindkey ^[K kill-line bindkey ^[V quoted-insert bindkey ^[X delete-char-or-list if ( $uid == 0 ) then # set prompt = '%S%m:%. #%s ' set prompt = '%{\e[41m%}%m:%. #%{\e[0m%} ' else if ( $?su ) then # set prompt = '%S%m:%. ?%s ' set prompt = '%{\e[45m%}%m:%. ?%{\e[0m%} ' else set prompt = '%S%m:%.%s ' endif set ampm color = ls-F dextract dunique histdup = prev histlit setty -istrip complete make 'n/-f/f/' 'c/*=/f/' \ 'n@*@`cat makefile Makefile |& sed -n "/No such/d; \ /^[^ #].*:/s/:.*//p"`@' endif endif unset savehist setenv AH alamode.hmrc.kines.umich.edu setenv BH alembic.hmrc.kines.umich.edu #etenv CH healthcheck.carelink.com.au setenv CH wellbeingassessment.ahm.com.au setenv FH alamoff.hmrc.kines.umich.edu #etenv GH web2.hmrc.kines.umich.edu #etenv LH login.itd.umich.edu setenv LH sftp.itd.umich.edu setenv MH moose.cs.indiana.edu setenv NH transi2 setenv PH ftp.hmrc.kines.umich.edu setenv SH swank.hmrc.kines.umich.edu setenv TH transit.hmrc.kines.umich.edu setenv WH www.hmrc.kines.umich.edu setenv YH trendy.hmrc.kines.umich.edu setenv ZH aludel.hmrc.kines.umich.edu if ( ! $?KH ) setenv KH kinzler.homeunix.com if ( $?HOST ) then setenv MIRRORHOST $KH if ( "$HOST" =~ ukinzler* ) setenv MIRRORHOST $BH endif set cdpath = ( ~ ~/l /usr/site /usr/local /l /var/spool /usr/spool /u ) set cdpath = ( $cdpath /mnt /media ) set cdpath = ( $cdpath /l/web/webhra/arc /l/web/webhra/arc/.abbrev ) setenv CD_PATH ${HOME}:$HOME/l:/usr/site:/usr/local:/l:/var/spool:/usr/spool:/u setenv CD_PATH ${CD_PATH}:/mnt:/media setenv CD_PATH ${CD_PATH}:/l/web/webhra/arc:/l/web/webhra/arc/.abbrev setenv COMPUTE $MH setenv CTWMRC ~/etc/ctwmrc setenv DOTREMINDERS ~/l/doc/reminders setenv GREP 'gnu grep' setenv GREP_COLOR 04 setenv GREP_OPTIONS --color=auto setenv GUILE_WARN_DEPRECATED no setenv HPATH /usr/local/lib/syn setenv HTMLVIEW 'xrshio - webrowse -saw' setenv ILERC ~/etc/ilerc setenv INPUTRC ~/.inputrc setenv IMGBGLNK ~/l/arc/images/imgbg% setenv IMGBGRC ~/etc/imgbgrc setenv LESS CMdefiq setenv LESSCHARSET latin1 setenv LESSHISTFILE - setenv LESSKEY ~/etc/lesskey setenv LOCAL_DICT ~/libp/words setenv MANPATH2 $HOME/manp:$HOME/man:$HOME/l/fun/man setenv PAGER view setenv PERLDOC_PAGER less setenv RC_FAVOR RCS setenv RCPCMD scp setenv RSHCMD ssh setenv TWMRC ~/etc/twmrc setenv URLVIEW 'xrshio - webrowse -uw' setenv URLTAB 'xrshio - webrowse -ut' setenv VSH vshnu # vsh* only setenv VSHRC ~/etc/vshrc setenv VSHNUCFG ~/etc/vshnucfg setenv VSHNURC ~/etc/vshnurc setenv WINEPREFIX ~/l/wine setenv WWW_HOME file://localhost$HOME/etc/work.html setenv XRSH_AUTH_TYPE none setenv ZOPTS '-gz -s .tgz -m -' setenv VIMCMD via setenv VISUAL "$VIMCMD" setenv EDITOR "$VISUAL" setenv MAIL /var/spool/mail/$USER if ( $?HOST ) then if ( "$HOST" =~ *.cs.indiana.edu ) setenv MAIL /nfs/mail$MAIL endif setenv MAILER 'mutt -z' #mail setenv MAILHOST $BH setenv PRINTER1 ps325a1 # simplex, 1-sided setenv PRINTER2 ps325a2 # duplex, 2-sided long edge, standard setenv PRINTERT ps325aT # tumble, 2-sided short edge, flip setenv PRINTER $PRINTER2 if ( $?HOST ) then if ( "$HOST" =~ ?kinzler* ) then setenv PRINTER epson_usb setenv PRINTER1 epson_usb endif endif setenv LPDEST "$PRINTER" setenv WB_KEEP forever setenv WB_PWD 'cwd -n' setenv WB_RUNURL seticonns setenv WB_NETSCAPE firefox #mozilla # see also ct,tw:/warpto.*Mozilla/ if ( $?HOST ) then # to enable audio in non-gnome Ubuntu, 6560 + uid if ( "$HOST" =~ ukinzler* ) setenv SPEECHD_PORT 7560 endif # also add kinzler to groups: audio video pulse pulse-access; restart if ( $?HOST ) then if ( "$HOST" =~ ?kinzler* ) setenv PILOTPORT net:any # autocreated when hotsync starts via /etc/udev/rules.d, # requires uucp group permissions, don't use ttyUSB1: if ( "$HOST" =~ alembic* ) setenv PILOTPORT /dev/ttyUSB0 endif setenv PILOTRATE 38400 if ( $?LINUX ) setenv PILOTRATE 115200 setenv XCOPILOTARGS "-datadir $HOME/l/palm/copilot -serial -ramsize 2048" setenv XCOPILOTMEMVERSION 2 setenv PALMUSER palmpre if ( ! $?LS_COLORS ) setenv LS_COLORS '' if ( ! $?LS_OPTIONS ) setenv LS_OPTIONS '' if ( ! $?TERMCAP || $?STY ) setenv TERMCAP ~/etc/termcap if ( "$TERMCAP" !~ */* && "$TERMCAP" !~ *=* ) setenv TERMCAP ~/etc/termcap if ( ! $?TERMINFO ) setenv TERMINFO ~/etc/terminfo # in case the system csh initialization undoes my .login's setenvls if ( $?BACKPATH && "$LS_OPTIONS" != '' && "$LS_COLORS" == '' ) then setenvls -c > /tmp/sls$$ source /tmp/sls$$; rm -f /tmp/sls$$ endif if ( ! $?XFILESEARCHPATH && $ARCHIT == sun4elf ) then set x = /usr/lib/X11 o = /usr/openwin/lib t = %T/%N%S setenv XFILESEARCHPATH $x/%T/%N%C%S:$x/${t}:$o/locale/%L/${t}:$o/$t unset x o t endif if ( $?REMOTEHOST ) then setenv RH "$REMOTEHOST" if ( "x$RH" == x ) setenv RH "$HOST" if ( $?DISPLAY && ! $?SSH_CLIENT && ! $?SSH2_CLIENT ) then if ( "$DISPLAY" !~ kinzler2* ) setenv DISPLAY "${REMOTEHOST}:0" endif endif setenv LANG C unalias cp unalias mv unalias rm alias ls 'gnu ls -a $LS_OPTIONS' alias lsc 'gnu ls -aC $LS_OPTIONS' alias lls 'gnu ls -al $LS_OPTIONS' alias lsl 'gnu ls -agl $LS_OPTIONS' alias l lls alias d 'ciph -x d; clear; cb; xcb -s 0-1 < /dev/null' alias D 'ciph -x d; clear; cb | xsel; xcb -s 0-1 < /dev/null' alias de 'ciph -x d; clear; cb | vip | cb; e' alias e 'ciph -x e; clear; cb | xsel; xcb -s 1 < /dev/null' alias _ "renam -p 's/[ \t]/_/g'" alias aptf 'dpkg -L' alias apti 'apt-get install' alias aptl 'dpkg --get-selections' alias aptr 'apt-get remove' alias apts 'aptitude search' alias at '(setenv SHELL /bin/sh; exec /usr/bin/at \!*)' alias catrm '(cat -- \!* && rm -- \!*)' alias cb cutbuf alias ccc 'cc -O -s -o \!^:r \!*' alias gccc 'gcc -O -s -o \!^:r \!*' alias cut80 'expand \!* | cut -c1-79' alias dat "date +'%Y-%m-%d %H:%M'" alias doc2txt 'antiword -f -w 79 -s' alias dodo 'todo -o' #lias e '$VISUAL' alias grep '$GREP' alias h 'pushd ~/work > /dev/null' alias hib 'screensaver blank lock; sudo hibernate' alias html2txt 'lynx -dump -force_html /dev/stdin' alias ifc ifconfig alias lc "renam -p '"'s/.*/\L$&/'"'" alias lcext "renam -p '"'s/\.[^.]+$/\L$&/'"'" alias m mail alias ma 'mailaudit -t && scph ma `hosts main`' alias mirror 'rsync -Haz --delete --force' # can add --dry-run alias mirrorv 'rsync -HazPv --delete --force --stats' alias ports 'netstat -ape --inet' # for changing symlink ownership, use with caution: #alias reln 'perl -e '\''for (@ARGV) { $l=readlink; unlink; symlink $l, $_ }'\' alias rmhl 'dailyh -D' alias rsh rshp alias scpw '$RCPCMD \!*\:/u/kinzler/work' alias so 'source ~/.cshrc' alias sortd 'sort | uniq -d' alias ssv screensaver alias sus 'sudo true; screensaver blank lock; sudo pm-suspend' alias ta '$VISUAL -t' alias tab 'expand | unexpand -a' #se WWW::Shorten; alias tinyurl shorten alias tls 'tree -aAC' alias tlls 'tree -aACpugsD' alias updateh 'hosts -l \!* | rdisth -' alias vi via alias vidiff 'vimdiff \!*; rmview \!* >& /dev/null' alias vifind 'vi `find \!*`' alias vilocate 'vi `locate \!*`' # WARNING: saving scp://files can change their permissions alias viscp 'vi scp://\!\!:1/`tag -f \!\!:2`' alias vidiffscp 'vidiff scp://\!\!:1/`tag -f \!\!:2` `tag -f \!\!:2`' alias wbid 'setenv WB_ID `xwinid -i $WB_NETSCAPE`' alias wheval 'echo $IUEVAL_USER $semester' alias www webrowse alias xtit 'setenv WINDOWID `xtitletag \!*`' alias yy 'echo \!-1 | cb' alias en 'babelfish -i es' alias es 'babelfish -o es' alias fr 'babelfish -o fr' alias nl 'babelfish -o nl' alias urldecode 'urlencode -d' alias htmlencode 'urlencode -H' alias htmldecode 'urlencode -H -d' alias to 'xtitle \!*; exec $RSHCMD \!*' alias toa 'xtitle alamode; exec $RSHCMD $AH' alias toA 'xtitle ALAMODE; exec $RSHCMD $AH' alias tob 'xtitle alembic; exec $RSHCMD $BH' alias toB 'xtitle ALEMBIC; exec $RSHCMD $BH' alias tof 'xtitle alamoff; exec $RSHCMD $FH' alias toF 'xtitle ALAMOFF; exec $RSHCMD $FH' alias ton 'xtitle $NH; exec $RSHCMD $NH' alias tor 'xtitle carelink; exec $RSHCMD $CH' alias toS 'xtitle SWANK; exec $RSHCMD $SH' alias work2k 'scph -r -X \!* $KH' alias work2z 'scph -r \!* $KH && ssh $KH cd work\;' \ 'scph -r -X \!* aludel && rm -r \!*' alias clearcols 'eval `cols unsetenv`' alias setcols 'cols setenv > /tmp/sc$$; source /tmp/sc$$; rm -f /tmp/sc$$' alias showcols 'cols show' alias sc setcols alias ckwebhra 'safe GET https://$WH/hra/isup.cgi |' \ 'grep -s HRA-OK > /dev/null || echo alamode Web HRA is down' alias ckwebhra2 'safe GET https://$CH/gehf/ |' \ 'grep -s Enter > /dev/null || echo carehra Web HRA is down' # The `sync` is an attempt to reduce the number of "tar: FILE: file changed # as we read it" messages. See # www.nabble.com/spurious-"file-changed-as-we-read-it"-error-td11968607.html alias bakmoose '(cd; sync; tar -czf - --exclude share/bak share .hyplan |' \ 'ssh $KH cat \> l/bak/moose.tgz) |& grep -v "as we read it"' alias bakwork '(umask 077; cd; atls > tmp/atls_`date +%Y%m%d`; sync;' \ 'tar -czPf l/bak/work.tgz work tmp $MAIL; rm tmp/atls_[0-9]*;' \ 'scph -q l/bak/work.tgz == $MH $KH)' # To be run on aludel: alias sshb 'ssh -R 2223:localhost:22 $BH' # Then can `ssh aludel` on alembic with /etc/hosts: # 127.0.0.1 ... aludel # and /etc/ssh/ssh_config: # Host aludel\n\tPort 2223 # # Also for /etc/ssh/ssh_config: # ForwardX11Trusted yes # ForwardX11 yes # to avoid "No xauth data; using fake authentication data" warnings # and permit xrsh's for xloads and xosviews # And for /etc/ssh/sshd_config: # ClientAliveInterval 240 # ClientAliveCountMax 180 # per per http://www.openssh.com/faq.html#2.12