0933009
# color-ls initialization
6feaf70
147167e
#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
147167e
if [ -z "$USER_LS_COLORS" ]; then
6feaf70
  
6ee11ab
  alias ll='ls -l' 2>/dev/null
6ee11ab
  alias l.='ls -d .*' 2>/dev/null
0933009
6feaf70
6feaf70
  # Skip the rest for noninteractive shells.
6feaf70
  [ -z "$PS1" ] && return
6feaf70
6feaf70
  COLORS=
6feaf70
6feaf70
  for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
6feaf70
      "$HOME/.dir_colors" "$HOME/.dircolors"; do
6feaf70
    [ -e "$colors" ] && COLORS="$colors" && break
6feaf70
  done
6feaf70
6feaf70
  [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \
6feaf70
      [ "`tput colors 2>/dev/null`" == "256" ] && \
6feaf70
      COLORS="/etc/DIR_COLORS.256color"
6feaf70
6feaf70
  if [ -z "$COLORS" ]; then
6feaf70
    for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do
6feaf70
      [ -e "$colors" ] && COLORS="$colors" && break
6feaf70
    done
6feaf70
  fi
6feaf70
6feaf70
  # Existence of $COLORS already checked above.
6feaf70
  [ -n "$COLORS" ] || return
0933009
6ee11ab
  eval `dircolors --sh "$COLORS" 2>/dev/null`
6ee11ab
  [ -z "$LS_COLORS" ] && return
6ee11ab
  egrep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return
0933009
fi
6ee11ab
6feaf70
alias ll='ls -l --color=auto' 2>/dev/null
6feaf70
alias l.='ls -d .* --color=auto' 2>/dev/null
6feaf70
alias ls='ls --color=auto' 2>/dev/null