]>
Commit | Line | Data |
---|---|---|
ab20b3dd JR |
1 | # skip everything for non-interactive shells |
2 | if (! $?prompt) exit | |
3 | ||
4 | if ( "`tty -s && tput colors 2>/dev/null`" == "256" ) then | |
5 | set RC_FILE="/etc/DIR_COLORS.256color" | |
6 | else | |
7 | set RC_FILE="/etc/DIR_COLORS" | |
8 | endif | |
3cf82251 | 9 | set USER_RC_FILE=$HOME/.dir_colors |
ab20b3dd | 10 | set DEF_COLOR_MODE=auto |
3cf82251 | 11 | |
2bf1419f | 12 | set COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $SYS_RC_FILE` |
3cf82251 | 13 | |
ab20b3dd | 14 | if ( -r $USER_RC_FILE ) then |
2bf1419f | 15 | set COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $USER_RC_FILE` |
ab20b3dd | 16 | set RC_FILE=$USER_RC_FILE |
3cf82251 | 17 | endif |
18 | ||
19 | # 'all' argument for 'ls --color=' is no longer valid | |
ab20b3dd | 20 | if ( "$COLOR_MODE" == "all" ) then |
3cf82251 | 21 | set COLOR_MODE=always |
22 | endif | |
23 | ||
ab20b3dd | 24 | if ( "$COLOR_MODE" == '') then |
3cf82251 | 25 | set COLOR_MODE=$DEF_COLOR_MODE |
26 | endif | |
27 | ||
28 | alias ls "ls --color=$COLOR_MODE" | |
29 | ||
ab20b3dd | 30 | eval `/usr/bin/dircolors -c $RC_FILE` |
3cf82251 | 31 | |
ab20b3dd | 32 | unset RC_FILE USER_RC_FILE DEF_COLOR_MODE COLOR_MODE |