Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2020 12:05:56 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        Jonesy <SPAM_TRAP_gmane@jonz.net>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: grep -b, --byte-offset returns 0
Message-ID:  <CACNAnaGC7_Xa51J83vCmo3%2BroyVzg5h6uTj3azZD_jY4OxMQkw@mail.gmail.com>
In-Reply-To: <slrnqu3d1q.40b.SPAM_TRAP_gmane@vps.jonz.net>
References:  <slrnqu3d1q.40b.SPAM_TRAP_gmane@vps.jonz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 31, 2020 at 12:03 PM Jonesy via freebsd-questions
<freebsd-questions@freebsd.org> wrote:
>
> (I'm not sure if I can post to this list via nntp/gmane...)
>
> grep'ping for a byte offset always returns 0 for the result.
> Searching "FreeBSD Bugzilla =E2=80=93 Bug List" shows no other reports.
>
> Ubuntu 16.04:
>
> jonesy@nix5:~$ a=3D'now is the time for all good men to come to the aid o=
f the party'
> jonesy@nix5:~$ echo $a | grep -b -o  good
> 24:good
>
>
> FreeBSD 12.1
>
> [jonz~]a=3D'now is the time for all good men to come to the aid of the pa=
rty'
> [jonz~]echo $a | grep -b -o  good
> 0:good
>
> I have just now created a login at bugs.freebsd.org/bugzilla/
> and reported this bug there, but I am unsure if I did it all
> correctly.   :-)
>
> Can someone confirm my findings?

I can confirm:

# echo 'now is the time for all good men to come to the aid of the
party'  | gnugrep -bo good
0:good

This is a non-issue in bsdgrep, FWIW:

# echo 'now is the time for all good men to come to the aid of the
party'  | bsdgrep -bo good
24:good

I hope to soon find more time to push us closer towards a bsdgrep
default, because gnugrep does not look good on us in many cases. =3D-(

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGC7_Xa51J83vCmo3%2BroyVzg5h6uTj3azZD_jY4OxMQkw>