7a1c1f8
# skip everything for non-interactive shells
7a1c1f8
if (! $?prompt) exit
7a1c1f8
0933009
# color-ls initialization
147167e
if ( $?USER_LS_COLORS ) then
147167e
  if ( "$USER_LS_COLORS" != "" ) then
5421281
     #when USER_LS_COLORS defined do not override user
147167e
     #specified LS_COLORS and use them
6ee11ab
     goto finish
6ee11ab
  endif
5d66c4c
endif
5d66c4c
0933009
alias ll 'ls -l'
0933009
alias l. 'ls -d .*'
0933009
set COLORS=/etc/DIR_COLORS
Ondrej Oprala 1ad51b6
0933009
if ($?TERM) then
c7a1b74
  if ( -e "/etc/DIR_COLORS.$TERM" ) then
c7a1b74
     set COLORS="/etc/DIR_COLORS.$TERM"
c7a1b74
  endif
0933009
endif
6ee11ab
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
6ee11ab
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
0933009
if ($?TERM) then
6ee11ab
  if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
6ee11ab
  if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
5d66c4c
endif
58ee249
set INCLUDE="`/usr/bin/cat "$COLORS" | /usr/bin/grep '^INCLUDE' | /usr/bin/cut -d ' ' -f2-`"
0933009
6ee11ab
if ( ! -e "$COLORS" ) exit
0933009
58ee249
set _tmp="`/usr/bin/mktemp .colorlsXXX -q --tmpdir=/tmp`"
2f8deb0
#if mktemp fails, exit when include was active, otherwise use $COLORS file
2f8deb0
if ( "$_tmp" == '' ) then
2f8deb0
  if ( "$INCLUDE" == '' ) then
58ee249
    eval "`/usr/bin/dircolors -c $COLORS`"
2f8deb0
  endif
2f8deb0
  goto cleanup
2f8deb0
endif
f0b6f85
58ee249
if ( "$INCLUDE" != '' ) /usr/bin/cat "$INCLUDE" >> $_tmp
58ee249
/usr/bin/grep -v '^INCLUDE' "$COLORS" >> $_tmp
Ondrej Oprala 1ad51b6
58ee249
eval "`/usr/bin/dircolors -c $_tmp`"
0933009
58ee249
/usr/bin/rm -f $_tmp
f0b6f85
6ee11ab
if ( "$LS_COLORS" == '' ) exit
2f8deb0
cleanup:
58ee249
set color_none=`/usr/bin/sed -n '/^COLOR.*none/Ip' < $COLORS`
5421281
if ( "$color_none" != '' ) then
6ee11ab
   unset color_none
6ee11ab
   exit
0933009
endif
0933009
unset color_none
Ondrej Oprala e8fe3e1
unset _tmp
72a0b59
unset INCLUDE
72a0b59
unset COLORS
6ee11ab
6ee11ab
finish:
6feaf70
alias ll 'ls -l --color=auto'
6feaf70
alias l. 'ls -d .* --color=auto'
6feaf70
alias ls 'ls --color=auto'