From owner-freebsd-questions Wed Mar 22 19:43: 1 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail1.noc0.hsacorp.net (mail1.noc0.hsacorp.net [208.247.171.140]) by hub.freebsd.org (Postfix) with ESMTP id 7890837C395 for ; Wed, 22 Mar 2000 19:42:49 -0800 (PST) (envelope-from jconner@enterit.com) Received: from [24.216.177.146] (HELO default.enterit.com) by mail1.noc0.hsacorp.net (CommuniGate Pro SMTP 3.2.3) with ESMTP id 9181614; Wed, 22 Mar 2000 22:42:46 -0500 Message-Id: <4.3.1.2.20000322224723.0247d100@pseudonet.org> X-Sender: jconner@mail.enterit.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Wed, 22 Mar 2000 22:47:28 -0500 To: rene@tp98.catv.szabinet.hu, R Joseph Wright From: Jim Conner Subject: Re: Shell Color Coding Cc: Matthew Jonkman , freebsd-questions@FreeBSD.ORG Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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