setup/profile.d/colorls.csh
2011-04-26 13:22:53 +02:00

31 lines
629 B
Tcsh

# color-ls initialization
alias ll 'ls -l'
alias l. 'ls -d .*'
set COLORS=/etc/dircolors
if ($?TERM) then
if ( -e "/etc/dircolors.$TERM" ) set COLORS="/etc/dircolors.$TERM"
endif
if ( -f ~/.dircolors ) set COLORS=~/.dircolors
if ($?TERM) then
if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
endif
if ( ! -e "$COLORS" ) exit
eval `dircolors -c $COLORS`
if ( "$LS_COLORS" == '' ) then
exit
endif
set color_none=`sed -n '/^COLOR.*none/Ip' < $COLORS`
if ( "$color_none" == '' ) then
alias ll 'ls -l --color=tty'
alias l. 'ls -d .* --color=tty'
alias ls 'ls --color=tty'
endif
unset color_none