From: dennisf@denix.elk.miles.com (Dennis Flaherty) Subject: Re: [Q] How to colorize directory listings? Date: Tue, 4 May 1993 19:18:07 GMT
In article <gilC6IIrq.70s@netcom.com> gil@netcom.com (Gilbert Nardo) writes:
> dennisf@denix.elk.miles.com (Dennis Flaherty) writes:
> > In article <1s4buo$17q@usenet.INS.CWRU.Edu> bf703@cleveland.Freenet.Edu (Patrick J. Volkerding) writes:
> > > Back when that "experimental" SLS A1 disk was floating around, I
> > > grabbed a copy and tried it out. One thing I really liked about it
> > > was the way it colored filenames according to file protections...
> >
> > If the 'ls' has been built from fileutils-3.4 with the color-ls patch,
> > it's either enabled or disabled (depending on the patch) by 'ls -f'...
>
> A note of caution when using this ls: some scripts rely on
> getting names via ls, but with the color option the command returns
> filenames with prepended escape codes (set color codes). This becomes
> a problem when the scripts are doing things like generating makefiles
> which require exact target name matching. If you are set on using
> the ls with color, then you may have to tack on the --no-color option
> for these cases (I don't know if there's an environment variable you
> can set to have this toggle on and off).
You're right: the older versions had color on by default, and you had to
use 'ls -f' to turn it off. This messes up a lot of news scripts that
use ls to find locks and batches. The new version will be OFF by
default, turned on by '-o'. I will recommend putting an alias of 'ls'
to 'ls -o' in your .zshrc or similar interactive startup file.
I've received quite a few email requests for the patch; once the other
author, Peter Anvin, and I finish it, I'll post it or ftp it somewhere.
I'll also send it off to the FSF for inclusion into fileutils.
-- Dennis T. Flaherty Linux Is Not UniX Home: dennisf@denix.elk.miles.com Miles, Inc.: dennisf@se01.elk.miles.com Notre Dame: dflahert@chekov.helios.nd.edu