On Thu, Apr 24, 2008 at 12:55:20AM +0200, Vincent Lefevre wrote:
> On 2007-12-25 10:20:43 +0100, Loïc Minier wrote:
> >  I think grep checks whether its output file descriptor is a tty to
> >  enable escape sequences.  I'll reassign to grep and suggest this;
> 
> This workaround would be bad: if one redirects the output to a file
> and "cat" the file, one wouldn't have the expected behavior. There
> should not be an output difference whether the file descriptor is a
> tty or not.

I wouldn't expect any specific behavior from cat'ing a file to the screen,
unless it had been formatted.  That's what a pager is for - to define the
behavior for unformatted text.

(if grep needs an option to produce formatted text, it should take into
account the destination).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Attachment: pgpbpRnTL7x2a.pgp
Description: PGP signature

Reply via email to