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