#  Title        : standard .cshrc file for all BITs users
#  Remarks      : Commands here are executed each time csh starts up.
#  Version      :       Tue, 25-Apr-95 / 09:14 / (rb,pf+,root,tc,mk,md)
#
umask   002                             # default protection mask
set ignoreeof				# don't let control-d logout
if (! $?TMP) then
    # Wenn diese Environment-Variable noch nicht gesetzt ist, 
    # dann muss es sich hier um eine Login-Shell handeln. Also :
    set LOGIN_CSH=1
    /bin/test -t || mesg y   # 'write' auf Terminal zulassen
    # ---
    set path = (/projects/bin /bitslib/bin /bitslib/etc \
		/usr/local/bin /usr/bin /bin .)
    # --- BITS environment : --------------
    #     the following definitions are required to run BITs: 
    setenv TMP	/tmp
    if (! $?BITSLIB) then
	setenv BITSLIB /bitslib
    endif
    setenv BITSENV /customer:$BITSLIB/env
    setenv BITSDAT $BITSLIB/dat
    setenv SDLLIB  /projects/sdl:$BITSLIB/sdl
    setenv TEXTURE /projects/texture:$BITSLIB/texture
    setenv RGB     /projects/rgb:$BITSLIB/rgb
    setenv ICONS   /projects/icons:$BITSLIB/icons
    setenv PRISMS  /projects/prisms:$BITSLIB/prisms
    setenv TABLES  /projects/tables:$BITSLIB/tables
    setenv BITSERR bitserr.srf
    setenv BITSMSG bitsmsg.srf
    # --- demnaechst loeschen : ---
    # setenv PSPC	   $BITSLIB/postscript/
    # --- denn ist ersetzt durch : ---
    setenv ARTSC   $BITSLIB/postscript/
    # just provide some defaults ... if the customer file is missing :
    setenv VMEM /projects/vmem/.VMEM
    # Das konkrete Grafik-Eingabegeraet wird durch /customer/.cshrc bestimmt !
    setenv GRDEVICE Mouse
    #    setenv DEPTHCUE Hiermussirgendetwasstehen!
    # --- Terminal-Type identifizieren : ---
    set noglob            
    set term = ansi
    /bin/test -t || set term = (`tset -h -mdialup:\?ansi -munknown:\?ansi -mansi:ansi -mvt102:vt102 -mh19:h19 -m :\?ansi -r -S -Q`)
    if ($#term > 0) then
	setenv	TERM	$term[1]
	if ($#term > 1) then
	    setenv	TERMCAP $term[2]		# terminal data base
	endif
    endif
    unset term noglob
    # --- Auf Andreas besonderen Wunsch : ;-) ---
    setenv CONSOLEPORT `/bitslib/bin/.consolPort`
    if ("$CONSOLEPORT" == "/dev/mono") then
	 setenv MIXTERM "ansi"
    else setenv MIXTERM "ansi-color"
    endif
    # Installationsspezifische Einstellungen vornehmen :
    #
    if ( -e /customer/.cshrc ) then
	source /customer/.cshrc
    endif
else 
    set LOGIN_CSH=0
endif
#
# --- Folgendes nur in interaktiven csh ausfuehren : ---
#
if ($?prompt) then
     set noclobber			# don't allow '>' to overwrite
     # -- The following applies only to interactive shells : --
     set history=512			# save commands
     # -- define a personal prompt :
     # --- first determine controlling tty line (nicht sehr elegant, aber ...)
     echo "[ -t ]" | sh
     if ($status == 0) then
	  set so="`tput smso`" 
	  set si="`tput rmso`"
	  # Die folgende Zeile muss leider so lang sein :
	  setenv TERMLINE `ps | awk '/csh/ {if(! done) { gsub(/tty/,""); printf "tty%s",$2; done=1}}'` 
     else setenv TERMLINE "null"
	  set so=""
	  set si=""
     endif
     # Aus historischen Gruenden :
     set me=(`logname` $TERMLINE)
     setenv me "$me"
     # --- Set prp1 (first part of prompt) so that login name, host and 
     #     controlling terminal will be shown in the prompt : ---
     expr "$TERMLINE" : "ttyp[0-9][0-9]" > /dev/null
     if ($status == 0) then
	  # Wahrscheinlich eine rlogin-Sitzung, nur dann Rechnernamen invers
	  # darstellen :
	  set prp1="$me[1]@${so}`uname -n`${si}:$me[2]"
     else set prp1="$me[1]@`uname -n`:$me[2]"
     endif
     # --- distinguish any sub shells :
     if ($?BITSSUBSH) then
	  set prp2="BITSUBSH>"
     else set prp2=">"
     endif
     # to include always an actual path into the prompt string :
     alias cd	'chdir \!*; set prompt="$prp1 `pwd` \\!$prp2"\ '   
     # --- set prompt string to updated value:
     set prompt="$prp1 `pwd` \!$prp2"\ 
     #
     alias hi    'history | tail -23'
     alias sane  'stty sane erase ^h echoe'
     alias becho '/bin/echo \!:*'
     alias fkey  'set qq=\!^;@ qq--;/bin/echo "\033Q$qq\!:2-$\c" >/dev/tty'
endif

alias ll    'ls -als \!* | more'
alias psl   'clear;ps -el \!:*'
# some MS-DOS look alike commands :
alias dir   'pwd ; ls -ACF'
alias del   'rm'
alias delq  'rm -i'
alias ren   'mv'
alias type  'cat \!* | more'
alias chkdsk 'df -v -i'
set sysname=`uname -n`
alias adjprn    'AdjPrn'
alias artldir   'ArtLDir'
alias key       'Key'
alias icopy     'ICopy'
alias combine   'Combine'
#  alias bits	'BITS'  # be aware of command script named 'bits' !!!!!
alias BITS      'bits'	# Program 'BITS' should never be started directly !
alias canon	'CANON'
alias compose   'Compose'
alias create	'Create'
alias display	'Display'
alias expose	'Expose'
alias ebvtapes  'EBVtapes'
alias ebvlinks  'EBVlinks'
alias hellansiband 'echo "Kommando nicht mehr vorhanden"'
alias hellansiexa  'echo "Kommando nicht mehr vorhanden"'
alias crosband     'echo "Kommando nicht mehr vorhanden"'
alias crosexa      'echo "Kommando nicht mehr vorhanden"'
alias crosread     'echo "Kommando nicht mehr vorhanden"'
alias crosexaread  'echo "Kommando nicht mehr vorhanden"'
alias etape 'mtape fname /dev/exa '
alias ehtape 'mtape fname /dev/exah '
alias filter    'Filter'
### alias hardcopy	'Proof -h'
alias hardcopy	'Proof display.dev'
alias hiqir	'HiQIR'
alias layout    'Layout'
alias retouch   'Retouch'
alias mdbtosdl	'MDBtoSDL'
alias merge	'Merge'
alias model	'Model'
alias osc	'OSC'
alias paint	'Paint'
alias polymodel 'PolyModel'
alias preview	'Preview'
alias prism	'Prism'
alias proof	'Proof'
alias psmtoavf  'PSMtoAVF'
alias psmtodxf  'PSMtoDXF'
alias dxftoavf  'DXFtoAVF'
# scale ist jetzt ein Shell-Skript in /bitslib/bin :
alias Scale     'scale'
alias scan	'Scan'
alias scodlrgb  'SCODLRGB'
alias scodlpsm  'SCODLPSM'
alias sepcat    'SepCat'
alias server    'Server'
alias sharp     'Sharp'
alias shuttle   'Shuttle'
alias tables	'Tables'
alias tdptape   'TDPtape'
alias tdpread   'TDPread'
alias texcrea	'TexCrea'
alias texfrac	'TexFrac'
alias trace	'Trace'
alias updatedb	'UpdateDB'
alias visimage  'VisImage'
alias viskill   'VisKill'
alias wm        'WM'
alias setP1VMEM	'source /bitslib/etc/SetP1VMEM'
alias setP2VMEM	'source /bitslib/etc/SetP2VMEM'
alias setPVMEM	'source /bitslib/etc/SetPVMEM'
alias setOVMEM	'source /bitslib/etc/SetOVMEM'
alias p1        'cd /projects1'
alias p2        'cd /projects2'
# ---- EOF ---
