Blame SOURCES/coreutils-colorls.csh

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