From owner-freebsd-questions@freebsd.org Fri Jan 31 18:06:09 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08D5E247E4E for ; Fri, 31 Jan 2020 18:06:09 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 488QBm6Z8bz42Fm for ; Fri, 31 Jan 2020 18:06:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id D18AA1E8A5 for ; Fri, 31 Jan 2020 18:06:08 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f43.google.com with SMTP id s7so3666514qvn.8 for ; Fri, 31 Jan 2020 10:06:08 -0800 (PST) X-Gm-Message-State: APjAAAVvfYRfBxLPiD2BZK6oXppkxyPwo7bcQXRm5reOdnwf/D+SGs4S SNoy0pQEpr4C+8iCj1mxTihfUMNX69fnhXdxlhI= X-Google-Smtp-Source: APXvYqwQh9tbvwWC9U2UKEzDGNMu6nZlmm+5R5H5STDao7KrLUQsBDe35LQtf/nItqJPtoXCSSIPAOpOJ/YdQQRjvIo= X-Received: by 2002:a05:6214:118d:: with SMTP id t13mr11312577qvv.5.1580493968473; Fri, 31 Jan 2020 10:06:08 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Evans Date: Fri, 31 Jan 2020 12:05:56 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: grep -b, --byte-offset returns 0 To: Jonesy Cc: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jan 2020 18:06:09 -0000 On Fri, Jan 31, 2020 at 12:03 PM Jonesy via freebsd-questions 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