e63663
# skip everything for non-interactive shells
e63663
if (! $?prompt) exit
e63663
e63663
# color-ls initialization
e63663
if ( $?USER_LS_COLORS ) then
e63663
  if ( "$USER_LS_COLORS" != "" ) then
e63663
     #when USER_LS_COLORS defined do not override user
e63663
     #specified LS_COLORS and use them
e63663
     goto finish
e63663
  endif
e63663
endif
e63663
e63663
alias ll 'ls -l'
e63663
alias l. 'ls -d .*'
e63663
set COLORS=/etc/DIR_COLORS
e63663
e63663
if ($?TERM) then
e63663
  if ( -e "/etc/DIR_COLORS.$TERM" ) then
e63663
     set COLORS="/etc/DIR_COLORS.$TERM"
e63663
  endif
e63663
endif
e63663
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
e63663
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
e63663
if ($?TERM) then
e63663
  if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
e63663
  if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
e63663
endif
e63663
set INCLUDE="`/usr/bin/cat "$COLORS" | /usr/bin/grep '^INCLUDE' | /usr/bin/cut -d ' ' -f2-`"
e63663
e63663
if ( ! -e "$COLORS" ) exit
e63663
e63663
set _tmp="`/usr/bin/mktemp .colorlsXXX -q --tmpdir=/tmp`"
e63663
#if mktemp fails, exit when include was active, otherwise use $COLORS file
e63663
if ( "$_tmp" == '' ) then
e63663
  if ( "$INCLUDE" == '' ) then
e63663
    eval "`/usr/bin/dircolors -c $COLORS`"
e63663
  endif
e63663
  goto cleanup
e63663
endif
e63663
e63663
if ( "$INCLUDE" != '' ) /usr/bin/cat "$INCLUDE" >> $_tmp
e63663
/usr/bin/grep -v '^INCLUDE' "$COLORS" >> $_tmp
e63663
e63663
eval "`/usr/bin/dircolors -c $_tmp`"
e63663
e63663
/usr/bin/rm -f $_tmp
e63663
e63663
if ( "$LS_COLORS" == '' ) exit
e63663
cleanup:
e63663
set color_none=`/usr/bin/sed -n '/^COLOR.*none/Ip' < $COLORS`
e63663
if ( "$color_none" != '' ) then
e63663
   unset color_none
e63663
   exit
e63663
endif
e63663
unset color_none
e63663
unset _tmp
e63663
unset INCLUDE
e63663
unset COLORS
e63663
e63663
finish:
e63663
alias ll 'ls -l --color=auto'
e63663
alias l. 'ls -d .* --color=auto'
e63663
alias ls 'ls --color=auto'