Blame SOURCES/coreutils-colorls.csh

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