Date: Thu, 14 Dec 2023 15:23:00 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 275764] `uniq -D -c` gives wrong values of repeat counts Message-ID: <bug-275764-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275764 Bug ID: 275764 Summary: `uniq -D -c` gives wrong values of repeat counts Product: Base System Version: 13.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: s110062131@m110.nthu.edu.tw CC: lwhsu@FreeBSD.org ## Environment: * FreeBSD 13.2-RELEASE * RPi 400 (bootloader 8ba17717 2023/01/11) * GENET version 5.0 phy 0x0000 ## Bug description: ```$ uniq -D -c``` gives wrong values of repeat counts. ## Steps to reproduce: 1. Assuming a file named animals.txt with the following content: alligator bear bear camel camel camel dolphin elephant bear fish fish bird lion koala koala koala 2. The following command should print all duplicated lines and repeat count= s: ``` $ uniq -D -c animals.txt ``` ## Actual result: ``` $ uniq -D -c animals.txt 1 bear 1 bear 1 camel 1 camel 2 camel 1 fish 1 fish 1 koala 1 koala ``` As you can tell, repeat counts are wrong. ## Expected result: ``` $ uniq -D -c animals.txt 1 bear 2 bear 1 camel 2 camel 3 camel 1 fish 2 fish 1 koala 2 koala ``` In fact, we actually tested it out on Linux as well.=20 ``` (Linux) $ uniq -D -c animals.txt uniq: printing all duplicated lines and repeat counts is meaningless Try 'uniq --help' for more information. ``` We think it might be another acceptable way to handle this bug. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275764-227>