From nobody Wed Dec 27 07:41:37 2023 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 4T0Nr24cJtz55Krv for ; Wed, 27 Dec 2023 07:41:38 +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 4T0Nr22rgWz3R27 for ; Wed, 27 Dec 2023 07:41:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703662898; a=rsa-sha256; cv=none; b=rcpYNHPMUEq2c/yRQ5vr0XT/k2WwlkBDRsmOEWvuaxwvb6qbkU626EJjTUPPOCG+mfXXx4 lXk+HW7VKgC0gOoMTjdD42MJyUSTlBTFpa73XyFcnxIUrlSvTsD1F3g7P4ZtjajuNtuFTg A/k5LnZYnKUEL+eG/sh5z7iOtcs8PK4jyedthjuUiIiZkjPUHzwq9ymLDUYal1izhJELkv SH2qaNMbkhLVzdXzU1JEgqbs7YnXHNzyXBExIelzs/4PtmZ2riQXW7Lzo6FuURlDgA5zJl eMEnyKDeLndNyuwNAnxu8XkXSrku1rKzJn9ET5HUGxBlgEcwoTE3DKOx0rqjiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703662898; 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: in-reply-to:in-reply-to:references:references; bh=2xSZ2r6B4EFE9eejWbAmyY9+kcZ06Q9l9uMd9ua2tsw=; b=WIvVT32htFKLn5pyw7QZFHrE6NecmYb2Sfy2SPZtVnprDZ4putIcfsQeL8V1uL4MQTGnw/ 8kRrAseLPAQrBeiwbixsqiv4nhfG2S5MpkxVYxXmtG7uDTFAlddGGA0cjzEX6YN5ZnDkMB VaPFUMbF6wPZ3DMgRIEuc18tHpRnkIcpj9xp2sMkph6jUqnlhqEgQOyerecMXWJrAEL5ts GSi/4euamqC3nnMWqOKy3eu9w17eyDDMSbNmaaGavew2mQXDcnAqIwbcf+CtKRzskdWJYw 6c+bgRoQef8DcdwdpurE8ScYJCJQ6raqab+XJlJShaWYRYDvHiQ9MQgOVBmVSg== 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 4T0Nr21wzyzVs6 for ; Wed, 27 Dec 2023 07:41:38 +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 3BR7fcQn028024 for ; Wed, 27 Dec 2023 07:41:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3BR7fcch028023 for bugs@FreeBSD.org; Wed, 27 Dec 2023 07:41:38 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 275764] `uniq -D -c` gives wrong values of repeat counts Date: Wed, 27 Dec 2023 07:41:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: tamelingdaniel@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: cc attachments.created Message-ID: In-Reply-To: References: 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275764 Daniel Tameling changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tamelingdaniel@gmail.com --- Comment #1 from Daniel Tameling --- Created attachment 247279 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D247279&action= =3Dedit possible patch The reason for this is that the code is designed for printing the repetition counts in front of the previous line. But if -D is specified, it prints the current line with the exception of the first duplicate. Thus, if one increa= ses the count before printing and not after, one gets a better result: $ uniq -D -c animals.txt 1 bear 2 bear 1 camel 2 camel 3 camel 1 fish 2 fish 1 koala 2 koala 3 koala --=20 You are receiving this mail because: You are the assignee for the bug.=