Michael B Allen(email@example.com) is reported to have said:
> Thomas Adam said:
> > --- Michael B Allen <firstname.lastname@example.org> 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.
I have had this around for years and it still works. Grom an old
#you can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
so i did that and them modified it to suit my tastes. Then added this to
# set up the color-ls environment variables:
if [ "$SHELL" = "/bin/zsh" ]; then
eval `dircolors -z ~/.dircolors`
elif [ "$SHELL" = "/bin/ash" ]; then
eval `dircolors -s ~/.dircolors`
eval `dircolors -b ~/.dircolors`
The day-to-day travails of the IBM programmer are so amusing to most of
us who are fortunate enough never to have been one -- like watching
Charlie Chaplin trying to cook a shoe.