Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2000 22:47:28 -0500
From:      Jim Conner <jconner@enterit.com>
To:        rene@tp98.catv.szabinet.hu, R Joseph Wright <rjoseph@speakeasy.org>
Cc:        Matthew Jonkman <jonkman@jonkmangarage.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Shell Color Coding
Message-ID:  <4.3.1.2.20000322224723.0247d100@pseudonet.org>

next in thread | raw e-mail | index | archive | help
At 12:01 AM 3/23/00 +0100, Rene Scott wrote:
>On Mar 21 R Joseph Wright wrote:
>
> > On Tue, 21 Mar 2000, Matthew Jonkman wrote:
> >
> > > A while ago I saw a little app that would color code the files and
> > > directories in a shell. I think it was on a linux box which probably does
> > > that by default.
> > >
> > > Does anyone know of a similar deal for freebsd? Seems like that would 
> save a
> > > boat-load of time scanning for certain things in ls outputs.
> > >
> > I use "gnuls" (/usr/ports/misc/gnuls).
> > Then I added the line [alias ls='gnuls --color=always'] to ~/.profile and
> > ~/.bashrc.  If you're not using bash, put the alias in whatever shell
> > dotfiles you have.
>
>Maybe a better approach to define a function like
>
>function ls
>{
>         gnuls --color=auto $@
>}
>
>  And with 'alias ls='gnuls --color=always' the following shell code on
>the command line should fail:
>
>for i in `ls`; do
>         ...
>done
>
>         Rene

Its been my experience in the past that using the --color=always is a bad 
idea.  If you were to perform a command:

ls -al

You would get the directory listing along with the escape sequences for the 
color coding.  Try using "[gnu]ls --color=auto".  This resolves any issues 
with the ls command displaying escape sequences.  Im not exactly sure what 
the shell scripting above is for but maybe this little tidbit is 
helpful.  It looks like the above is simply stating that by using the 
--always param for ls the for loop would fail.

- Jim


> >
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
> >
>
>--
>UNIX was never designed to keep people from doing stupid things, because
>that policy would also keep them from doing clever things.   (Doug Gwyn)
>
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Today's errors, in contrast:
Windows - "Invalid page fault in module kernel32.dll at 0032:A16F2935"
UNIX  - "segmentation fault - core dumped"
Humanous Beingsus - "OOPS, I've fallen and I can't get up"
-------------------------------
Jim Conner
NOTJames
jconner@enterit.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.3.1.2.20000322224723.0247d100>