[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DIR_COLORS



Thomas Adam said:
>  --- Michael B Allen <mba2000@ioplex.com> wrote:
>> Would anyone happen to know why?
>
> eval `dircolors -b`
>
> has always been what has worked for me:
>
> [n6tadam@station n6tadam]$ unset LS_COLORS
> [n6tadam@station n6tadam]$ eval $(dircolors -b)
> [n6tadam@station n6tadam]$ echo $LS_COLORS

That's basically what I was doing:

eval `dircolors --sh /etc/DIR_COLORS`

where /etc/DIR_COLORS was stolen from Red Hat. The --sh option is an alias
for -b. If I run the above on the commandline it works as advertised. But
when executed in /etc/profile it does not work. It exports LS_COLORS= but
the value is empty. I can see this by adding "env > /tmp/out" immediately
after the eval command and looking at /tmp/out. Maybe some environment
variable needs to be set like TERM=xterm.

>
> [..output snipped..]
>
> You can uncomment the use of "eval `dircolors -b`" in ~/.bashrc

I did. Also, noteworthy that if I change that line to "eval `dircolors -b
/etc/DIR_COLORS` it works. Of course it only works for me so it's still
not satisfactory.

Mike



Reply to: