]> git.pld-linux.org Git - packages/coreutils.git/blob - fileutils.sh
- Honor 'COLOR' setting && ~/.dir_colors
[packages/coreutils.git] / fileutils.sh
1 SYS_RC_FILE=/etc/DIR_COLORS
2 USER_RC_FILE=$HOME/.dir_colors
3 DEF_COLOR_MODE=tty
4
5 COLOR_MODE=`grep ^COLOR $SYS_RC_FILE |head -n 1|cut -c 7-`
6
7 [ -r $USER_RC_FILE ] && COLOR_MODE=`grep ^COLOR $USER_RC_FILE |head -n 1|cut -c 7-`
8
9 [ -z "$COLOR_MODE" ] && COLOR_MODE=$DEF_COLOR_MODE
10
11 alias ls="ls --color=$COLOR_MODE"
12
13 if [ -r $USER_RC_FILE ]; then
14         eval `/usr/bin/dircolors -b $USER_RC_FILE`
15 else    
16         eval `/usr/bin/dircolors -b $SYS_RC_FILE`
17 fi
This page took 0.054276 seconds and 4 git commands to generate.