From /etc/bash/bashrc: use_color=false safe_term=${TERM//[^[:alnum:]]/.} # sanitize TERM if [[ -f /etc/DIR_COLORS ]]; then grep -q "^TERM ${safe_term}" /etc/DIR_COLORS && use_color=true elif dircolors --print-database | grep -q "^TERM ${safe_term}"; then use_color=true fi Now, I'm not entirely sure why this doesn't work. In a standard (non-X) terminal, colours work fine. However, in the above, TERM and safe_term both get set to xterm, I don't have a /etc/DIR_COLORS, the dircolors command outputs a line saying "TERM xterm", but colours still don't show. use_color is still set to false. If anyone can shed any light on this I'd be most grateful. I really can't work it out.
Okay, turns out that despite my getting rid of /etc/DIR_COLORS, a zero-byte file returned in its place. Possibly thanks to a remerge of coreutils - I'm not sure. Can someone more au fait with coreutils please confirm or deny my suspicion?
What version of bash do you have? Have you run through all the etc-update stuff? My /etc/bash/bashrc does not reference /etc/DIR_COLORS at all, and I get colors just fine after deleting /etc/DIR_COLORS.
matthew: your bash is out of date, the latest one does refer to DIR_COLORS
Somehow I just reemerged bash-3.0-r5 and got a different config file. I'm not really sure what's going on.
what version of coreutils do you have Robert ?
5.2.1-r2, and this problem is gone now in this version; this was the version I was originally using when I reported this, so this can be closed. Cheers... :-)