color option for /bin/ls breaks shell scripts
Charles Jones
charles.jones at ciscolearning.org
Wed Jul 2 13:53:15 MST 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20080702/36c1e917/attachment.htm
More information about the PLUG-discuss
mailing list