From nobody Sun Nov 13 19:48:48 2022 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N9NKs10nzz4ffDc for ; Sun, 13 Nov 2022 19:48:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N9NKr6wmkz4DNC for ; Sun, 13 Nov 2022 19:48:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668368929; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uB2rTMyFVHROPk9xUEANN2iz/555BDmFc38aIKRZ8SM=; b=nW51cN2k+FeX2sPWy/HYFCsu+xJdg4sjA0Shwnu/fvw3K6Y8RGNVGHqmM6nb3pvKzFEGaZ 3tI2Nr5631BpXb2HdILcO7zTC9OzCVUpiy0a3TogeaSaoQEzO3j3iTtuRcoevcRzTpBeha spoY8Li5GI9QkX99sZpMmTZN644Zq2jZ4HkX981rb8D0nhXV9LlqEUQH5RDPLM5clFAQDc uu9/kIYP1abrRMe8xIwbt9k4aGnRRzYYWmVyZJsNr3qlAUhyc/Yf1OitxfjYYrKfQvTj3d CsRdORSgVanvkLoeuTrBwt+WnapY53A4heeMPK2sumYZwQGohgZ2w/yroBkwyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668368929; a=rsa-sha256; cv=none; b=bXnc53Yt3xI3lGtcFayCOCH4s+TMFC47QS4eFfCdvDdPdD3ihIwVW6NpTcxuoKUxbpYUYJ h07g1angZc3MDEVfAPWDjVFHuV6qDMcOMC5vW/AX3neH6nlcVLXa/0UdEw6AcNlaFj6tk0 zd41NmZ5+/7JXFNsN9gO9+I+ag/JQOvJLBlt+RtnuiXoQelNo9JFXgn6gvsdVwHD0GyHwK NAKCF/+xM6OKz0XAZXQFqkWA4TUhh5MPJ6jKoDqsIq0atYBrgdv1s/emeYnoE1yN+hdD8v PvVsL/04hgI2gJYRdjiePjJYP1eBD5Gb1zh0x0UkweFhm2O3p/KXIelKkQbMoA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N9NKr5c3SzF2Z for ; Sun, 13 Nov 2022 19:48:48 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2ADJmmFD036156 for ; Sun, 13 Nov 2022 19:48:48 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2ADJmmKE036155 for bugs@FreeBSD.org; Sun, 13 Nov 2022 19:48:48 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 267749] Running "grep -Fivx -f known.words new.words" gives wrong result Date: Sun, 13 Nov 2022 19:48:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jonathan.leffler@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267749 Bug ID: 267749 Summary: Running "grep -Fivx -f known.words new.words" gives wrong result Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: jonathan.leffler@gmail.com Created attachment 238058 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238058&action= =3Dedit List of known words in the repro The command "grep -Fivx -f known.words new.words" is meant to compare a list of putatively new words against a list of known words, reporting only those new words not present amongst the known words. The context is a script for helping with the New York Times "Spelling Bee" puzzle, but that doesn't matter much. Testing "grep (BSD grep) 2.5.1-FreeBSD" as found on macOS Big Sur 11.7.1 against "grep (GNU grep) 2.27", I get different results for the following files: New Words: decedent deceived decident detected dietetic Known Words: Civic Decedent Deceit Deceive Deceived Decent Decide Decided Deiced Detect Detected Detective Device Dice There are no blanks in the files; the only white space is the newlines. There are no blank lines in the files. GNU grep produces the (correct) list: decident dietetic BSD grep produces the (incorrect) list: deceived decident detected dietetic Both "deceived" and "detected" are in the list of known words and neither should be reported. I believe this is a bug in BSD grep. My short-term workaround is to use GNU grep, but I'd rather it wasn't necessary. I'm not clear whether this should be reported to Apple or FreeBSD (or both). (I think I ran into 253209 "grep -v -f some-empty-file -- does the wrong th= ing" previously, but I worked around that, too. It isn't directly relevant to t= his bug, though; neither file is empty in this bug.) --=20 You are receiving this mail because: You are the assignee for the bug.=