[Top][All Lists]

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

Re: found bug

From: Bob Proulx
Subject: Re: found bug
Date: Mon, 10 Sep 2018 13:40:49 -0600
User-agent: Mutt/1.10.1 (2018-07-13)

Hello Karl,

Karl Riauba wrote:
> I think I found egrep bug.
> No tabs in example file or in variable.
> should suppose to be filtered out, but it doesn't.

I as well tried to reproduce this bug.  I was unable to do so.  It
works for me okay using grep 3.1.

What version of grep are you using?  You can post this using the
--version option.

  grep --version

Eric suspects you must be using a very old version due to the use of
this mailing list for bug submission.  If your version is very old
then it may have been a bug in that older version that was fixed in
the intervening years.  It would still be interesting to know here
what version of grep you are using.

> $ echo ===$egrep===

At this point the $egrep variable was not quoted.  Oops.  Therefore
any amount of whitespace error may have been introduced there that
will be invisible to us.

  echo "===$egrep==="

> === | | |
> | | |

And then the email was word wrapped which is a very annoying feature
of your mailer.  Again it makes it difficult to reproduce bugs
exactly.  If you can't convince your mailer not to word wrap then
sometimes these files may be attached verbatim and therefore show the
problem without the mailer causing us problems.

> $ cat egrep_bug
> tcp        0      0  *               LISTEN
>     12160/statsd_export

Argh!  Again the mailer word wrapping this text drives people trying
to reproduce your report crazy! :-(

> tcp        0      0  *               LISTEN
>     12160/statsd_export
> tcp        0      0

But here appears to be the main point of your report.  The string is in the file and has at least one space both
before and after it.  The grep pattern included that same string with
a very likely but unprovable one space both before and after it.
Therefore it should match that line but appears to you to not have
matched it.

However to me reading this report the most likely cause of the problem
is multiple spaces in the pattern before that address and therefore
not matching due to whitespace problems.

My hopefully helpful advice to you is to quote your variables so that
whitespace is not split by the shell.  And then double check very
closely the amount of whitespace in the pattern.  If your case is
really a bug in grep then please say the version of grep.  And if it
is an older version please try it with a newer version to see if the
problem has been fixed since that older version.


reply via email to

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