Re: color option for /bin/ls breaks shell scripts

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Jones
Date:  
To: Main PLUG discussion list
Subject: Re: color option for /bin/ls breaks shell scripts
Charles Jones wrote:
> So he learned some valuable lessons:
> 1. Always call binaries by their full path (use /bin/ls) so you don't
> get bitten by an alias or something in $PATH overriding
> 2. bash -x -c 'command(s)' is helpful for debugging command-line shell
> 3. In some cases it's better to use something like: find . -name \*doc
> -exec command \;

I also forgot:

4. You can safely alias ls to use color, if you use --color=auto.

From the ls man page:
?With --color=auto, color codes are output only if standard output is
connected to a terminal (tty).

-Charles
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss