From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 13:38:10 2015 Received: (at submit) by debbugs.gnu.org; 25 Dec 2015 18:38:10 +0000 Received: from localhost ([127.0.0.1]:35300 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCXFh-0001b0-Sw for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:38:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60377) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCXFf-0001an-VO for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:38:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCXFZ-0002bw-Ds for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:38:02 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCXFZ-0002bs-AS for submit@debbugs.gnu.org; Fri, 25 Dec 2015 13:38:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCXFY-0006ek-5G for bug-coreutils@gnu.org; Fri, 25 Dec 2015 13:38:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aCXFW-0002be-QL for bug-coreutils@gnu.org; Fri, 25 Dec 2015 13:38:00 -0500 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:32919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCXFW-0002ba-K4 for bug-coreutils@gnu.org; Fri, 25 Dec 2015 13:37:58 -0500 Received: by mail-qk0-x235.google.com with SMTP id k189so178996624qkc.0 for ; Fri, 25 Dec 2015 10:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uZlJcvAlSkzozwSSgRTFR60Fb5/8uMWkg9LqIBpAw/s=; b=n5gStZa8UmyDClp2xQ5Jv8ml0jD51qWRClmKguUTCeBhf7v3vbtxuisXGJFtjNpBb1 WVY6Fnr9LB8zABXFdjRyjaPqe/7rb9xKi9mkJH2kTSRUsDsVaMp/7cUnOuzsDKgLImdN HbKnM+P77zyB/A/O0vrpxCCgscpoF92YerWoE+kGsOaio31M7HMoWKh6I3jXdKMx2QFr dltRycS1Bvf+0ZZs24brJeAYbCyrdvgGtHpfzUPsOZTIaX1oJj1dwhb3SM8l29geORzA b8gOT9w+Hn7P4TT5VAhQAAJnRv2bg8qkAxRb2SzkDpTJB+VOD8G24+BfLjZ6itVHNuaQ aDoA== MIME-Version: 1.0 X-Received: by 10.55.80.86 with SMTP id e83mr55200542qkb.91.1451068677996; Fri, 25 Dec 2015 10:37:57 -0800 (PST) Received: by 10.55.96.131 with HTTP; Fri, 25 Dec 2015 10:37:57 -0800 (PST) Date: Fri, 25 Dec 2015 12:37:57 -0600 Message-ID: Subject: Not exactly a bug... From: Todd Shandelman To: bug-coreutils@gnu.org Content-Type: multipart/alternative; boundary=001a114a6a9618c9090527bd412e X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --001a114a6a9618c9090527bd412e Content-Type: text/plain; charset=UTF-8 Hi, I love your products. I am using the 'uniq' command line utility on Cygwin, where I do most of my development work. $ uniq --version uniq (GNU coreutils) 8.24 Packaged by Cygwin (8.24-3) Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Richard M. Stallman and David MacKenzie. $ I feel confused about the usage options, particularly those for restricting comparison to a limited number of initial or non-initial characters or fields. Observe: $ uniq --h|egrep 'char|field' -f, --skip-fields=N avoid comparing the first N fields -s, --skip-chars=N avoid comparing the first N characters -w, --check-chars=N compare no more than N characters in lines ... ... ... So it looks like that for *chars*, 'uniq' has options to compare only the first N chars, or *all but* the first N chars. Whereas for *fields*, 'uniq' has only the option to skip the first N fields, but has no corresponding option to compare *only* the first N fields. Why this lack of symmetry? And what do I do when I need that missing functionality, to compare *only *an initial subset of fields in each line? Ot, am I missing something? Thanks! Todd Shandelman Houston, Texas --001a114a6a9618c9090527bd412e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I love your products.
I am using the 'uniq' command line utility on Cygwin, w= here I do most of my development work.

$ uniq --version
uniq (GNU coreutils) 8.24
Packaged by Cygwin (8.24-3)
= Copyright (C) 2015 Free Sof= tware Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
= This is free software: you = are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law= .

Written by Richard M. Stallman and David Ma= cKenzie.
$=



I feel confused about the usage options, particularly those for res= tricting comparison to a limited number of initial or non-initial character= s or fields.

Observe:

$ uniq --h|egrep 'char|field'
=C2=A0 -f, --skip-fie= lds=3DN =C2=A0 avoid comparing the first N fields
=C2=A0 -s, --skip-chars=3DN =C2=A0 = =C2=A0avoid comparing the first N characters
=C2=A0 -w, --check-chars=3DN =C2=A0 compa= re no more than N characters in lines
<= br>
...
...
...

<= div>So it looks like that for chars, 'uniq' has optio= ns to compare only the first N chars, or *all but* the first N chars.

Whereas for fields, 'uniq' ha= s only the option to skip the first N fields, but has no corresponding opti= on to compare *only* the first N fields.

Why this = lack of symmetry? And what do I do when I need that missing functionality, = to compare only an initial subset of fields in each line?
=
Ot, am I missing something?

Thanks!=

Todd Shandelman
Houston, Texas








--001a114a6a9618c9090527bd412e-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 25 18:37:09 2015 Received: (at 22236) by debbugs.gnu.org; 25 Dec 2015 23:37:09 +0000 Received: from localhost ([127.0.0.1]:36129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCbv2-0000nU-O1 for submit@debbugs.gnu.org; Fri, 25 Dec 2015 18:37:08 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:32812) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aCbv1-0000nH-2l for 22236@debbugs.gnu.org; Fri, 25 Dec 2015 18:37:07 -0500 Received: by mail-qk0-f173.google.com with SMTP id k189so180132968qkc.0 for <22236@debbugs.gnu.org>; Fri, 25 Dec 2015 15:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=m/evJHkasyU2PHmZs7Wkw0XjAvrQETb5vOIkx4nkQac=; b=Was5hYv8Mc8ToR9t8EmfQr/0D6jvr208USLW9T3ajbh+cISIgAbLzQtvg6rS/6aiZ/ adxALm0peXkJGC8Ysz1NviIfohryfB99G8kY4zwWjFfY6SkBI2GexuRvq6jepANPWKVI ACMGYcMM+vxUQ5gqgyvN55s7vsXJj0zJrTrDPh196ho8FpACc3509ByJwKNzQHdan8Q3 IydzaqK7cJ1fLFzxJWSLXfOxmopZ2/j/tekzcJoZ4SqzOSCRitV/HiKzb90ailBg7ERB i8KIdRogbXpzcC7ple8W112kDQNUP0MWQLYamJcsh4GYIBvQLuLzTxAGLLHp36ApjJ31 E4pQ== X-Received: by 10.55.75.212 with SMTP id y203mr58497934qka.3.1451086621454; Fri, 25 Dec 2015 15:37:01 -0800 (PST) Received: from [172.20.2.33] ([207.237.164.119]) by smtp.gmail.com with ESMTPSA id z132sm7655835qka.14.2015.12.25.15.37.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Dec 2015 15:37:00 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: bug#22236: Not exactly a bug... From: Assaf Gordon In-Reply-To: Date: Fri, 25 Dec 2015 18:36:58 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <3DC32062-41B0-4D46-89A5-3FBA72686951@gmail.com> References: To: Todd Shandelman X-Mailer: Apple Mail (2.2102) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22236 Cc: 22236@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tag 22236 notabug close 22236 thanks Hello Todd, > On Dec 25, 2015, at 13:37, Todd Shandelman = wrote: [...] > So it looks like that for chars, 'uniq' has options to compare only = the first N chars, or *all but* the first N chars. >=20 > Whereas for fields, 'uniq' has only the option to skip the first N = fields, but has no corresponding option to compare *only* the first N = fields. >=20 > Why this lack of symmetry? This lack of symmetry originates from the POSIX standard: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/uniq.html Which codified the existing features at that time. GNU Coreutils' uniq program have added few more features, and there is a = working plan to add the ability to use specific fields ( = http://lists.gnu.org/archive/html/coreutils/2013-02/msg00082.html , = http://lists.gnu.org/archive/html/coreutils/2013-09/msg00047.html ) but = this has not yet been integrated into the main program - perhaps in = future versions. > And what do I do when I need that missing functionality, to compare = only an initial subset of fields in each line? To print unique lines of specific fields you can use 'sort': Example, given the following sample input file: $ cat input.txt 1 A 10 x 100 5 B 14 z 104 2 A 11 x 101 3 B 12 y 102 4 B 13 z 103 Print only lines with unique values in columns 2 and 4: $ sort -k2,2 -k4,4 -s -u input.txt 1 A 10 x 100 3 B 12 y 102 5 B 14 z 104 This can be extended to include as many fields as you need. If the fields are consecutive, you can specify them as so: $ cat input2.txt A x 1 97 B x 1 96 A x 1 99 A x 1 98 $ sort -k1,3 -u input2.txt=20 A x 1 97 B x 1 96 regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 24 17:38:45 2018 Received: (at control) by debbugs.gnu.org; 24 Oct 2018 21:38:46 +0000 Received: from localhost ([127.0.0.1]:40833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQrV-0000hp-OH for submit@debbugs.gnu.org; Wed, 24 Oct 2018 17:38:45 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:39715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQrT-0000hd-No for control@debbugs.gnu.org; Wed, 24 Oct 2018 17:38:45 -0400 Received: by mail-pf1-f180.google.com with SMTP id c25-v6so3083742pfe.6 for ; Wed, 24 Oct 2018 14:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=3Lq54ZM6peypQhjN/mGvF0hMaBxGkwhiCXS5bLd2bmU=; b=h3sDMZqYm+rYakKKya3p+XD+VIwFj6DytXKycqTWML9g1pkMzabIzEaS7qKrdYcAdJ 7o+meqoaxLAKSuWd9+phY8wgiYVn0wsAGxj0jIRCosyc3J/yuWEFO3hQ5Yik2F82Q/bw FFGexkUKzUExDw9XzfZruL4qECkXUIaXyMvfeMgIjr0kUL5hZmM3s9akDub1bQJY3tbK ChIy3p0c4UE4xQIRfBwmpSmDfWdxorM2KooGxAMmMYbSqyXT2dhmHNr1ZktAFvxc/8wS BWQTeUzR3Pdj/qpAY8Q3BnhiaoQM2D1d3qqzDWskaWIjDGHqtO5NMBr6htYYOXs58NDj oe9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=3Lq54ZM6peypQhjN/mGvF0hMaBxGkwhiCXS5bLd2bmU=; b=W77wJpWa7RpDxGHJmF+QZUgiBM78GLff20rLmXOjf30Zo3429ciW+fGJv7um3dgDgb CtxicQ/HDa7k5VsRYpYRRW0PiO363ZFd3Fi1jJk93JpTsbWbHZpORTdZAGgkM5g4hs6J 1A6mGdXiEsaL+pD5dZZbhKjFjnqYiAsM1Sxuh8xeYn+sOv1J0BWY/lTmgwZ7Vz4wRwKM Oeu565w1z9TMCrMuvSZhuRrNTkyD28UJIZ/nYttUsGG8hvaoVdEMNo0y4dfRwtJepXiU xRFoLYUZbRFjYNI4MFlnwqtPO9wevnskt7KWM8+WTJZv0wk9xROs+DrJ05IDNv4Rt9fT v+KQ== X-Gm-Message-State: AGRZ1gIHi+El/GAniAu5LTCGW8HPlL0sX/tBcm9/Gs7uGmmDZTvIgFU5 pD+hRix0RCuC6FqLsu3cFFJYj3Sx5k4= X-Google-Smtp-Source: AJdET5foQmIbjsdO+SaQMBNLPvzOhTB1BH2bkEbdOBRCDi1LQc3YQGTyA8oEVNDO7N3ZCAkwGNd9AA== X-Received: by 2002:a63:f844:: with SMTP id v4mr4042673pgj.82.1540417117550; Wed, 24 Oct 2018 14:38:37 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id i2-v6sm5941464pgq.35.2018.10.24.14.38.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 14:38:36 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <350a5965-d3bb-c65a-2ee0-92b7cc8525a9@gmail.com> Date: Wed, 24 Oct 2018 15:38:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 22236 notabug close 22236 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.210.180 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.210.180 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 22236 notabug close 22236 From unknown Thu Aug 14 22:14:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 22 Nov 2018 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator