On Tue, Nov 11, 2008 at 03:28:06PM -0700, Bryan Sant wrote: > So I'm too lazy to look through the cat code, but I'm guessing that > cat is explicitly striping ANSI codes (??). Or is the shell (or > something else) doing something magical? You don't get any color/ANSI > codes if you do "ls > foo" either. I don't fully understand why.
ls checks to see if stdout is a tty. If stdout isn't a tty then it doesn't output any non-printable characters (including ANSI escape sequences). ls also limits output to one item per line after detecting that stdout is not a tty. -- Byron Clark /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
