[Top][All Lists]

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

Re: PROBLEM: ls --color outputs undesirable leader and trailer

From: Bob Proulx
Subject: Re: PROBLEM: ls --color outputs undesirable leader and trailer
Date: Wed, 11 Jun 2003 22:54:39 -0600
User-agent: Mutt/1.3.28i

gregory mott wrote:
> Bob Proulx wrote:
> > gregory mott wrote:
> > > problem:  ls --color's output is almost compatible with sort, but is
> > > wanting of a minor modification.
> > Is 'ls --color' something you are doing or something Redhat is doing?

> not sure what you mean exactly, i believe the --color feature is
> implemented by gnu, not redhat, redhat's profile.d stuff likely has
> aliases that invoke --color=auto, anwyay i have my own aliases that do
> color=always.

Yes.  --color is a gnu ls option.  A lot of people do not know that
Red Hat puts those aliases in their environment and since it is
non-traditional has been a source of problems and bug reports.  But
knowing that you are setting up your own is great.  Just trying to
make sure that was not a source of confusion.

> > I recommend that if you want color that you try using the auto option
> > instead of always.  Try 'ls --color=auto' instead.  That turns off the
> > escape sequences when the output is a pipe.

> i like still getting color when i pipe to less, or sort
> and then less.  my whole point in writing you is that it works, and
> would work well even for the less sophisticated who weren't ready to
> implement a little filter hack like i did if the whole ls --color=always
> output were no longer enclosed by those nonfunctional leading and
> trailing color setting escape sequences.

Ah, now I see.  Thanks for the clarification.  I was not sure if you
were just having trouble sorting because of the escape sequences or
something else.  Now I see that it was not the mere presence of escape
sequences but the content and that you were suggesting an enhancement
to make things even more useful.

> the reason i invoke sort is to separate the directories from the files. 
> come to think of it, now that i have your attention, how about that as
> an option for ls?  i mean, i already do it for myself, so i don't care,
> but it's the kind of thing that would be another modicum of improvement
> for gnu/linux in general, heck it's just a popular (for me anyway)
> feature that even msdos has had for years.

That is not an isolated request.  If you google for "site:gnu.org ls
sort directories" you will find a number of messages talking about
this ability.

> since you also mention locale i will also mention that i do have a
> personal locale i made just for the purpose of sorting things the way i
> want.  my locale sorts case intermixed.

Locales such as 'en_US' also fold case.  Actually that is one of my
problems with it.  I personally don't like "dictionary" sort ordering
for directory listings and other such things but prefer a standard C
sort ordering instead.

> anyway no matter what you do or don't do with any of this, thank you for
> supporting gnu/fsf.

Many, many people donate their time and energies to the public good of
free software.  Your suggestions and discussions are most welcome.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]