ls colors - command substitution - mainly a bash question

SirKnight sirknight at ntur.net
Sun Jul 15 13:01:20 PDT 2001


try this in your .bash_profile
alias ls='ls --color=tty'

----- Original Message -----
From: "Kevin Krumwiede" <krum at oco.net>
To: <lfs-discuss at linuxfromscratch.org>
Sent: Sunday, July 15, 2001 9:49 AM
Subject: ls colors - command substitution - mainly a bash question


> I wanted to set ls colors automatically at each login by sourcing the
output
> of dircolors.  I tried to use command substitution to run the output of
> dircolors, but it doesn't work.  I tried this:
>
> # $(echo 'echo foo')
>
> This prints 'foo'.  But this fails:
>
> # $(dircolors /etc/DIR_COLORS)
>
> Bash complains about LS_COLORS='<yadda yadda>' not being a valid command.
> Bug or feature?  A similar thing happens if you try to set a variable by
> running a command contained in a variable:
>
> # FOO='BAR=baz'
> # $FOO
>
> This obviously works:
>
> # dircolors /etc/DIR_COLORS > setcolors; source setcolors
>
> ...but I don't like it.  I ended up adding the output of dircolors to my
> .bashrc, but I'm still curious as to why command substitution doesn't work
> here.
>
> Krum
>
> --
> Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
> and put unsubscribe in the subject header of the message

-- 
Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message



More information about the lfs-dev mailing list