Wednesday, September 24, 2008

cshrc

####################################################
  #!/bin/tcsh
unset autologout
  set ignoreeof
  set filec
  set history = 200
  set osversion=`uname`
  xmodmap -e 'keycode 22 = BackSpace'
   
  setenv MANPATH /usr/man:/usr/openwin/man
   
  setenv PATH .
  setenv PATH $HOME/bin:$PATH
  setenv PATH /bin:$PATH
  setenv PATH /sbin:$PATH
  setenv PATH /usr/bin:$PATH
  setenv PATH /usr/sbin:$PATH
  setenv PATH /usr/local/bin:$PATH
  setenv PATH /usr/X11R6/bin:$PATH
  setenv PATH /magnum/tools/novas/verdi-10.2/bin:$PATH
  setenv PATH /magnum/tools/cadence/RC62USR2/bin:$PATH

####################################################

#! /bin/csh -fset osversion=`uname`alias a aliasa cls cleara ls ls -F --colora acroread "acroread \!* &"a l lsa L lsa LS lsa lcd lsa ld 'ls -d \!*|\grep /$'#a ld '\ls --color -F1 | \grep /$'#a ld 'find . -type d -maxdepth 1'a lc 'ls -1 \!*|grep -c ""'a lls lla llt ll -rta le lessa f finda fm "ftp sb1500-001.magnumsemi.com"a h historya h1 head -1a h2 head -2a k kill -9a kd "kdiff3 \!* &"#a g xvia g gvima gd g -da go g -oa gO g -Oa gt g --remote-tab-silenta vo v -oa vO v -Oa grep grep --colora gc grep --colora gl grep -la glw grep -lwa gw grep -wa pd pushda rf rm -fa v via vr vi -Ra qk 'qstat |\grep -w "\!*"|awk "{print $1}"|xargs qdel'a x 'xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qx 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000 &'a qxf 'Q xterm -bd "#7f7f00" -fg "#7f7f7f" -bg black -cr "#ff7f7f" -geometry 101x35 -fn 9x15bold -sl 2000'a so sourcea CD cda cdl "cd ~/goto_lynley;l"#a cdc "cd ~/thunder2/run/r3ksource/csrc/test"#a cds "cd ~/thunder2/run/sim"a cdh "cd ~/thunder2/hdl"a . pwda .. "cd .."a ... "cd ../.."a .... "cd ../../.."a ..... "cd ../../../.."a ...... "cd ../../../../.."a Q "qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -cwd \!*"a Qsh 'echo "start at `date`"; qrsh -l mem_free=25G -l num_proc=4 -now no -V -noshell -b y -cwd -l lic_sim=1 -l simh \!*;echo "finish at `date`"'#a Q 'qrsh -l mem_free=25G -l num_proc=4 -now no -noshell -cwd \!*'a udc "unsetenv DISPLAY"a la ls -aa lt ls -t -la ll ls -la lm 'll |more'a lr 'ls -ltd'a pvnc 'ps aux |grep vnc'a rm rm -ia boo '\rm #*; \rm *~'a cdd cd ..a cp cp -ipa nc ncveriloga h history#a gvim gvim -reverseunalias test### hg/mercurial relateda hl "hg log|more"a hv hg viewa hs "hg status|grep -v ^\?"a hjs "hg jstatus|grep -v ^\?"a hgg "hg glog|grep ^@; echo 'latest hg log:';hg log|head -2"a hj "hg jpull |tee ~/hg.log; hg jupdate |tee -a ~/hg.log;date"set HOSTNAME=`hostname`if ($HOSTNAME =~ *bj*) then a hjpu 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'hg jrebase /proj/lynley/ws/hgmirror/mrepo/mrepo > /dev/null;set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; hg jrebase ssh://$USER@mrepo//magnum/hg/mrepo > /dev/null;\echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'else a hjpu 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"' a hjpuc 'set startTime=`date`;hg jpull --root \!*|tee ~/hg.log; hg jupdate -C --root \!*|tee -a ~/hg.log;date; \echo -e "hjpu started at\t$startTime\n\tended at\t`date`"'endifa hjpul 'hjpu hw/fe/Lynley/proj/dev@\!*'a hjpui 'hjpu hw/fe/interconnect/verif/dev@\!*'a hjpuit 'hjpui tip'a hpu "hg pull \!*; hg update \!*"a simvision 'simvision -waves \!* &'a sv "simvision waves.shm/waves.trn"if ($osversion == "Linux") then set mach_type="`uname -m`" a vi vim #alias vi "/home/lfchen/bin/vim -v" #alias vim "/home/lfchen/bin/vim" #alias vi "/usr/bin/vim -v" #alias vim "/usr/bin/vim" #alias vi "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias vim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" #alias gvim "/usr/X11R6/bin/gvim -font MiscFixed -reverse" alias xterm "/usr/X11R6/bin/xterm" #setenv VIMRUNTIME "/cirrus/linuxapps/local/share/vim/runtime" #setenv VIMRUNTIME "/home/lfchen/share/vim/runtime" alias xvi vim -g #if ($mach_type == "x86_64") then #alias xvi "/cirrus/linuxapps/local/bin/bit64/vim -g" #endifendif## for xml flowa cdroot "so ~lfchen/scripts/mgnmFlow/cdRoot"a cdr "cdroot;ssm"a ssm "source ~lfchen/scripts/mgnmFlow/set_mrepo"## set my personal favorite IPNAME by force. But I don't need to override now.#setenv IPNAME interconnectsetenv ipname interconnectsetenv intf hw/fe/common/rtl/interfaces/devsetenv tiwir mtools/veriTools/dev/tiwirsetenv tests hw/tests/$ipname/dev/svsetenv verif hw/fe/$ipname/verif/devsetenv run $verif/runsetenv src $verif/srcsetenv rtl hw/fe/$ipname/rtl/devsetenv xml xml/impl/ip/$ipname/devsetenv ovm hw/fe/common/verif/ovmsetenv ovmahb $ovm/ahb/dev/08.20.002-s/vr_ahb/svsetenv ovmocp $ovm/ocp/dev/srcsetenv ovmmcbus $ovm/mcbus/dev/srcsetenv ovmcbus $ovm/cbus/dev/srca cdmem 'cdr;cd hw/fe/common/memories/Lynley/dev'a cdgen 'cdr;cd mtools/generators/dev'a cdinc 'cdr;cd hw/fe/Lynley/verif/dev/common/include'a cdinc 'cdr;cd hw/fe/common/rtl/interfaces/dev'a cdxml 'cdr;\\ if (a"\!*" != a"") \\ cd xml/impl/ip/\!*/dev;\\ if (a"\!*" == a"") \\ cd xml/impl/ip/$ipname/dev;\\ 'a cdrtl 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/rtl/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/rtl/dev;\\ 'a cdsdc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/gate/asic/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/gate/asic/dev;\\ 'a cdrun 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/run;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/run;\\ 'a cdverif 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev;\\ 'a cdsrc 'cdr;\\ if (a"\!*" != a"") \\ cd hw/fe/\!*/verif/dev/src;\\ if (a"\!*" == a"") \\ cd hw/fe/$ipname/verif/dev/src;\\ 'a cdtests 'cdr;\\ if (a"\!*" != a"") \\ cd hw/tests/\!*/dev/sv;\\ if (a"\!*" == a"") \\ cd hw/tests/$ipname/dev/sv;\\ 'setenv shortName `echo $HOSTNAME|cut -f1 -d"."`#try DISPLAYa d 'echo $DISPLAY'a sdf 'echo $DISPLAY >! ~/.display'a sdfe 'echo $DISPLAY |tee ~/.display'set myTTY=`who am i | awk '{ print $2 }'`set myHOSTNAME=`w | grep -w "$myTTY" | awk '{ print $3 }'`set myVNC=94if (! -f ~/.display) touch .displaya vdc "setenv DISPLAY ${myHOSTNAME}:$myVNC.0; sdf" #engvnca pdc "setenv DISPLAY 172.18.20.31:0; sdf" #bj pca mdc "setenv DISPLAY milcitrix.ad.magnumsemi.com:0.0; sdf" #172.16.4.229:0a gdc "setenv DISPLAY ${USER}-pc.ad.magnumsemi.com:0.0; sdf" #172.16.4.165:0a mvnc vncserver -geometry 1350x1000 :94### personal settingsif ($USER != lfchen) exitif ("$myHOSTNAME" =~ milfarm*) then setenv DISPLAY `cat ~/.display` #echo login from $myHOSTNAMEelse if ("$myHOSTNAME" =~ engvnc*) then vdc sdfelse if ("$myHOSTNAME" =~ milcitrix*) then mdc sdfelse if ("$myHOSTNAME" =~ ${USER}*) then gdc sdfelse #login from pc if ($HOSTNAME =~ *bj*) then pdc else gdc endif sdfendif
###########DISPLAY SET###########################
alias sdp setenv DISPLAY 172.16.18.5:10

if ($osversion == "Linux") then
  set mach_type="`uname -m`"
  alias pscheck "/bin/ps -Af | grep -v root"
else
  alias pscheck "/bin/ps -Af -o pid,etime,user,args | grep -v root"
endif

####################################################

#


set cd_cnt=0
alias sp 'set prompt="%{\033[33;44m%}\\![%.3\]%{\033[0m%}:\ ";\\
if("$shortName" !~ milfarm11*) set prompt="$shortName $prompt";\\
if("$cd_cnt" >= 20) \echo -e "PWD: \033[1;33;41m$PWD\033[0m";\\
if("$cd_cnt" >= 20) set cd_cnt=0\\
'
sp
alias cd 'chdir \!* ; sp; setenv PWD `pwd`; set cd_cnt=`echo $cd_cnt+1|bc -l`;' # redefine cd command

alias pushd 'if("\!:0-$" == pushd) pushd;\\
if("\!:0-$" != pushd) pushd \!$;\\
sp'
alias popd 'if ("\!:0-$" == popd) popd;\\
if ("\!:0-$" != popd) popd \!$;\\
sp'

####################################################
content of .dir_colors

# Configuration file for the color ls utility
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.

# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty

# Extra command line options for ls go here.
# Basically these ones are:
# -F = show '/' for dirs, '*' for executables, etc.
# -T 0 = don't trust tab spacing when formatting ls output.
OPTIONS -F -T 0

# Below, there should be one TERM entry for each termtype that is colorizable
TERM linux
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM xterm
TERM rxvt
TERM xterm-color
TERM color-xterm
TERM vt100
TERM dtterm
TERM color_xterm
TERM ansi
TERM screen
TERM screen.linux
TERM kon
TERM kterm
TERM gnome
TERM konsole

# EIGHTBIT, followed by '1' for on, '0' for off. (8-bit output)
EIGHTBIT 1

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes: 
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00 # global default, although everything should be something.
FILE 00 # normal file
DIR 04;36 # directory
LINK 01;36 # symbolic link
FIFO 40;33 # pipe
SOCK 01;35 # socket
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
ORPHAN 01;05;37;41 # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to

# This is for files with execute permission:
EXEC 01;32 

# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')
.cmd 01;32 # executables (bright green)
.exe 01;32
.com 01;32
.btm 01;32
.bat 01;32
.sh 01;32
.csh 01;32
.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z 01;31
.Z 01;31
.gz 01;31
.bz2 01;31
.bz 01;31
.tz 01;31
.rpm 01;31
.cpio 01;31
.jpg 01;35 # image formats
.gif 01;35
.bmp 01;35
.xbm 01;35
.xpm 01;35
.png 01;35
.tif 01;35

No comments: