2008-01-31 15:55:47 +00:00
|
|
|
#! /bin/csh -f
|
2007-02-26 13:04:00 +00:00
|
|
|
# color-ls initialization
|
2008-01-31 15:55:47 +00:00
|
|
|
if ( "$LS_COLORS" != '' ) then
|
|
|
|
#do not override user specified LS_COLORS and use them
|
|
|
|
alias ll 'ls -l --color=tty'
|
|
|
|
alias l. 'ls -d .* --color=tty'
|
|
|
|
alias ls 'ls --color=tty'
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
|
2007-02-26 13:04:00 +00:00
|
|
|
alias ll 'ls -l'
|
|
|
|
alias l. 'ls -d .*'
|
|
|
|
|
|
|
|
set COLORS=/etc/DIR_COLORS
|
|
|
|
if ($?TERM) then
|
2008-01-31 15:55:47 +00:00
|
|
|
if ( -e "/etc/DIR_COLORS.$TERM" ) then
|
|
|
|
set COLORS="/etc/DIR_COLORS.$TERM"
|
|
|
|
endif
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
2008-01-31 15:55:47 +00:00
|
|
|
if ( -f ~/.dircolors ) then
|
|
|
|
set COLORS=~/.dircolors
|
|
|
|
endif
|
|
|
|
if ( -f ~/.dir_colors ) then
|
|
|
|
set COLORS=~/.dir_colors
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
|
|
|
if ($?TERM) then
|
2008-01-31 15:55:47 +00:00
|
|
|
if ( -f ~/.dircolors."$TERM" ) then
|
|
|
|
set COLORS=~/.dircolors."$TERM"
|
|
|
|
endif
|
|
|
|
if ( -f ~/.dir_colors."$TERM" ) then
|
|
|
|
set COLORS=~/.dir_colors."$TERM"
|
|
|
|
endif
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
|
|
|
|
2008-01-31 15:55:47 +00:00
|
|
|
if ( ! -e "$COLORS" ) then
|
|
|
|
exit
|
|
|
|
endif
|
2007-02-26 13:04:00 +00:00
|
|
|
|
|
|
|
eval `dircolors -c $COLORS`
|
|
|
|
|
|
|
|
if ( "$LS_COLORS" == '' ) then
|
|
|
|
exit
|
|
|
|
endif
|
|
|
|
|
|
|
|
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
|
|
|
|
if ( "$color_none" == '' ) then
|
2008-01-31 15:55:47 +00:00
|
|
|
alias ll 'ls -l --color=tty'
|
|
|
|
alias l. 'ls -d .* --color=tty'
|
|
|
|
alias ls 'ls --color=tty'
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
|
|
|
unset color_none
|