2008-01-31 15:55:47 +00:00
|
|
|
#! /bin/csh -f
|
2007-02-26 13:04:00 +00:00
|
|
|
# color-ls initialization
|
2008-03-27 14:38:08 +00:00
|
|
|
if ( $?USER_LS_COLORS ) then
|
|
|
|
if ( "$USER_LS_COLORS" != "" ) then
|
|
|
|
#when USER_LS_COLORS defined do not override user
|
|
|
|
#specified LS_COLORS and use them
|
2008-02-04 16:49:24 +00:00
|
|
|
goto finish
|
|
|
|
endif
|
2008-01-31 15:55:47 +00:00
|
|
|
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-02-04 16:49:24 +00:00
|
|
|
if ( -e "/etc/DIR_COLORS.$TERM" ) then
|
|
|
|
set COLORS="/etc/DIR_COLORS.$TERM"
|
|
|
|
endif
|
2008-01-31 15:55:47 +00:00
|
|
|
endif
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( -e "/etc/DIR_COLORS.256color" ) then
|
2008-02-14 14:43:46 +00:00
|
|
|
if ( "`tput colors`" == "256" ) then
|
2008-02-04 16:49:24 +00:00
|
|
|
set COLORS=/etc/DIR_COLORS.256color
|
|
|
|
endif
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
|
|
|
|
if ( -f ~/.dir_colors ) set COLORS=~/.dir_colors
|
2007-02-26 13:04:00 +00:00
|
|
|
if ($?TERM) then
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
|
|
|
|
if ( -f ~/.dir_colors."$TERM" ) set COLORS=~/.dir_colors."$TERM"
|
2008-01-31 15:55:47 +00:00
|
|
|
endif
|
2007-02-26 13:04:00 +00:00
|
|
|
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( ! -e "$COLORS" ) exit
|
2007-02-26 13:04:00 +00:00
|
|
|
|
2008-02-08 16:27:31 +00:00
|
|
|
eval `dircolors -c $COLORS`
|
2007-02-26 13:04:00 +00:00
|
|
|
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( "$LS_COLORS" == '' ) exit
|
2007-02-26 13:04:00 +00:00
|
|
|
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
|
2008-02-04 16:49:24 +00:00
|
|
|
if ( "$color_none" != '' ) then
|
|
|
|
unset color_none
|
|
|
|
exit
|
2007-02-26 13:04:00 +00:00
|
|
|
endif
|
|
|
|
unset color_none
|
2008-02-04 16:49:24 +00:00
|
|
|
|
|
|
|
finish:
|
2008-02-18 14:37:04 +00:00
|
|
|
alias ll 'ls -l --color=auto'
|
|
|
|
alias l. 'ls -d .* --color=auto'
|
|
|
|
alias ls 'ls --color=auto'
|