[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28306: grep: option to filter non-printable characters from contents

From: Santiago R.R.
Subject: bug#28306: grep: option to filter non-printable characters from contents
Date: Thu, 31 Aug 2017 17:38:19 +0200

Dear grep upstream authors,

I'd like to forward this bug reported to debian

On Tue, 9 Sep 2008 11:07:33 +0200 Vincent Lefevre <address@hidden> wrote:
> grep should have an option to filter non-printable characters from
> the contents (file contents, but also filenames -- see bug #42630)
> *before coloring*. The values could be "never", "always" and "auto",
> like with --color.
> Such an option would be useful because:
> 1. The option --binary-files is a heuristic only; the user may want
>    to have more information on binary files anyway.
> 2. It is not even possible to write a wrapper script when coloring is
>    used, because after coloring, it is not possible (or at least very
>    difficult) to do the difference between escape sequences from grep
>    and those from the original contents.
> Such non-printable characters could be either replaced by some
> locale-specific replacement character or transcoded.
> I wonder whether filtering should be the default when the output
> is connected to a terminal (and when POSIXLY_CORRECT is not set).
> It would not be worse than the default --binary-files=binary.

This option could be also useful to filter undesirable behaviors, such
as ringing the bell terminal (from stdin in this case):

    printf '\a'x | grep x

What's your position on this?


  -- Santiago

PS. As Vincent Lefevre says, this bug relates to filtering non-printable
characters from filenames:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]