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