From unknown Mon Jun 16 23:47:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34347 <34347@debbugs.gnu.org> To: bug#34347 <34347@debbugs.gnu.org> Subject: Status: comm: add 2nd error message after output Reply-To: bug#34347 <34347@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:47:41 +0000 retitle 34347 comm: add 2nd error message after output reassign 34347 coreutils submitter 34347 =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson severity 34347 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 06 07:51:37 2019 Received: (at submit) by debbugs.gnu.org; 6 Feb 2019 12:51:37 +0000 Received: from localhost ([127.0.0.1]:34109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grMfv-00024j-KI for submit@debbugs.gnu.org; Wed, 06 Feb 2019 07:51:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1grMft-00024V-GE for submit@debbugs.gnu.org; Wed, 06 Feb 2019 07:51:34 -0500 Received: from lists.gnu.org ([209.51.188.17]:47783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grMfo-0001Ua-6H for submit@debbugs.gnu.org; Wed, 06 Feb 2019 07:51:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grMfn-0003N7-EW for bug-coreutils@gnu.org; Wed, 06 Feb 2019 07:51:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_50,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grMfm-0001U8-PM for bug-coreutils@gnu.org; Wed, 06 Feb 2019 07:51:27 -0500 Received: from catfish.maple.relay.mailchannels.net ([23.83.214.32]:39165) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grMfm-0001SK-BQ for bug-coreutils@gnu.org; Wed, 06 Feb 2019 07:51:26 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 8F989681881 for ; Wed, 6 Feb 2019 12:51:17 +0000 (UTC) Received: from pdx1-sub0-mail-a27.g.dreamhost.com (unknown [100.96.26.166]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 448176832EE for ; Wed, 6 Feb 2019 12:51:17 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a27.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 06 Feb 2019 12:51:17 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Desert-Rock: 58b59dc77adf00b8_1549457477389_294808490 X-MC-Loop-Signature: 1549457477389:697723424 X-MC-Ingress-Time: 1549457477388 Received: from pdx1-sub0-mail-a27.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTP id E078280277 for ; Wed, 6 Feb 2019 04:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=jidanni.org; bh=3Tri/eP6hXhcWq78zP ukOpi7cQU=; b=mQRlqimhJ/i3XP3qbenHLoMD4l74eDXbYszrBt8kdY4lgMu+Ye KcjbMMj7j0VabAp3IYUO4I32PXUhp9A694snrbKzRUjj0NHIz6/b6zAZX2cXCg6B ye/JdrhfhwGmWicK4E9A7wCG9jKkEE0al8ZdeP+TQvMhLGZel91mVuc78= Received: from jidanni.org (36-234-98-104.dynamic-ip.hinet.net [36.234.98.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a27.g.dreamhost.com (Postfix) with ESMTPSA id 7E71780286 for ; Wed, 6 Feb 2019 04:51:15 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a27 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-coreutils@gnu.org Subject: At least add 2nd comm error message after output Date: Wed, 06 Feb 2019 20:16:21 +0800 Message-ID: <87sgx1t8mi.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrkeekgdegjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgfgsehtkeertddttdejnecuhfhrohhmpejnnjjnucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqeenucfkphepfeeirddvfeegrdelkedruddtgeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepjhhiuggrnhhnihdrohhrghdpihhnvghtpeefiedrvdefgedrleekrddutdegpdhrvghtuhhrnhdqphgrthhhpeeprehuthhfqdekreeureehiehmpfehnfhiheehsgevkeerpecuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqpdhmrghilhhfrhhomhepjhhiuggrnhhnihesjhhiuggrnhhnihdrohhrghdpnhhrtghpthhtohepsghughdqtghorhgvuhhtihhlshesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.214.32 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.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: 0.0 (/) (info "(coreutils) comm invocation") "Before =E2=80=98comm=E2=80=99 can be used, the input files must be sorte= d" ^^^^ "If an input file is diagnosed as being unsorted, the =E2=80=98comm=E2=80= =99 command will exit with a nonzero status (and the output should not be used). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "Forcing =E2=80=98comm=E2=80=99 to process wrongly sorted input files ...= is not guaranteed to produce any particular output. The output will probably not correspond with whatever you hoped it would be." OK, so I would change the default. The new default should be: before producing even a line of output, check both files. If either of them is in order, print the error message, and exit non-zero... _without any line of output!_ Because currently, $ seq 55 > 5 $ seq 55 |tac > 5r $ comm 5 5r just causes the error messages to fly off the screen, leaving only the savvy user, who checks exit values, to have any inkling that there is a problem, and he should not order futher warships, airplanes, etc. based on the results after all. OR, be so kind as to add a second error message after all the output is printed, so it won't fly off the screen. From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 08 15:33:30 2019 Received: (at control) by debbugs.gnu.org; 8 Feb 2019 20:33:30 +0000 Received: from localhost ([127.0.0.1]:40170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsCq2-0001Wo-1s for submit@debbugs.gnu.org; Fri, 08 Feb 2019 15:33:30 -0500 Received: from mail-pg1-f179.google.com ([209.85.215.179]:40828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsCq0-0001WY-7v for control@debbugs.gnu.org; Fri, 08 Feb 2019 15:33:28 -0500 Received: by mail-pg1-f179.google.com with SMTP id z10so2069806pgp.7 for ; Fri, 08 Feb 2019 12:33:28 -0800 (PST) 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=M8ScfItowUuX9DhHMyzmDFR64xkkbfIFr6VBMwSIoRU=; b=IlGG+1nUwWj50U86Z4bEeu1FKSUamxDFN8kOW7PqWlQBfaTs7GgVM8s232Z1Fzy9o9 ADgvq/pvUwXK+3bYMqjehfg8ltj+QnDAmo5upBw5gkS02w5FijwjbIPFmLiABGrNx5+i mWftu0FQPVXHwEVG2fw0eYAsE0508utRt2lUXSCF3Xpdi2zbThkj0v31MtfOMKupQEXE l0myBGcdsHJh0i3/Z7S6EqI5gaHMYJTT9g8RZNf4oW5I1k/VDM1ua/FQpx4vFKtWVTB3 DjsQ6RniXymc2/GoHl033rWg5e+8n+8FkUu8La3sYo87XwTxYokOQdaAoeQDTN4fSDwn MR3A== 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=M8ScfItowUuX9DhHMyzmDFR64xkkbfIFr6VBMwSIoRU=; b=BC0T8JjRsz+5JIiJz1egxI1Af+Zo+vLr4YUX19DPXPS37ZJoGb5alh7FbNUi+wJNM7 id2xCSZ+vlj+D3h0BK6k1SuYjiD0r9vwKIUeFwEOxs7laaoSS1L6FvMMQEJWVu/PVe5Q fmSXl7uVt5nYey/M4EM3XwYoitLogn2JGz3r2XrpDKW6oaeYegbFsQJql4PFtBNqy2ZF QSaM9+Fh2ROVF2yRxFoW9AuN+9rA2q6bj4ME4rblIPWjdEBHIvKP7MvNQom9a+sAo3vR ayggyrELSgDBBIytecj9OFfJlFPApIZxQYuiOvkgT2O6h4u0T8G8lqG3z5EyxTAIV7ts tkBA== X-Gm-Message-State: AHQUAuYAr6L031qbtKyLKGSe9snmJLU6HXBDY99vfepWurgLZbKQkVPv fDw5N5Fyjqx31/7LU8c8jxAvTuwO X-Google-Smtp-Source: AHgI3IZ9ek/mdgW598bK0c6dpd/YAOFDFdbuXGUsWp+7vwWkxcjz0l64UFJdP5G5DPa7dpTgsdBNyw== X-Received: by 2002:a65:60c5:: with SMTP id r5mr7064931pgv.427.1549658001698; Fri, 08 Feb 2019 12:33:21 -0800 (PST) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id v13sm4234260pff.20.2019.02.08.12.33.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 12:33:20 -0800 (PST) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <51417f8e-fc37-d463-017e-4ef5a8f5a9bc@gmail.com> Date: Fri, 8 Feb 2019 13:33:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 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: severity 34347 wishlist retitle 34347 comm: add 2nd error message after output Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.215.179 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) 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 (+) severity 34347 wishlist retitle 34347 comm: add 2nd error message after output From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 09 14:20:55 2019 Received: (at 34347-done) by debbugs.gnu.org; 9 Feb 2019 19:20:55 +0000 Received: from localhost ([127.0.0.1]:41529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsYBL-0001da-9a for submit@debbugs.gnu.org; Sat, 09 Feb 2019 14:20:55 -0500 Received: from mail.magicbluesmoke.com ([82.195.144.49]:38216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gsYBJ-0001dQ-F1 for 34347-done@debbugs.gnu.org; Sat, 09 Feb 2019 14:20:53 -0500 Received: from localhost.localdomain (unknown [76.21.115.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id A23BFAA7F; Sat, 9 Feb 2019 19:20:51 +0000 (GMT) Subject: Re: bug#34347: At least add 2nd comm error message after output To: =?UTF-8?B?56mN5Li55bC8IERhbiBKYWNvYnNvbg==?= , 34347-done@debbugs.gnu.org References: <87sgx1t8mi.fsf@jidanni.org> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <615de121-7a0f-4c77-2ad2-c32b426fcf5e@draigBrady.com> Date: Sat, 9 Feb 2019 11:20:49 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <87sgx1t8mi.fsf@jidanni.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34347-done 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 (-) On 06/02/19 04:16, 積丹尼 Dan Jacobson wrote: > (info "(coreutils) comm invocation") > > "Before ‘comm’ can be used, the input files must be sorted" > ^^^^ > "If an input file is diagnosed as being unsorted, the ‘comm’ command > will exit with a nonzero status (and the output should not be used). > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > "Forcing ‘comm’ to process wrongly sorted input files ... is not > guaranteed to produce any particular output. The output will probably > not correspond with whatever you hoped it would be." > > OK, so I would change the default. > > The new default should be: before producing even a line of output, > check both files. If either of them is in order, print the error > message, and exit non-zero... _without any line of output!_ > > Because currently, > > $ seq 55 > 5 > $ seq 55 |tac > 5r > $ comm 5 5r > just causes the error messages to fly off the screen, leaving only the > savvy user, who checks exit values, to have any inkling that there is a > problem, and he should not order futher warships, airplanes, etc. based > on the results after all. > > OR, be so kind as to add a second error message after all the output is > printed, so it won't fly off the screen. This is a fair point. Note the --check-order option is stricter and will exit upon the first error message. join has the same considerations, so this should handle both: cheers, Pádraig diff --git a/src/comm.c b/src/comm.c index da8d5cf..6f46c98 100644 --- a/src/comm.c +++ b/src/comm.c @@ -493,7 +493,7 @@ main (int argc, char **argv) compare_files (argv + optind); if (issued_disorder_warning[0] || issued_disorder_warning[1]) - return EXIT_FAILURE; + error (EXIT_FAILURE, 0, _("input is not in sorted order")); else return EXIT_SUCCESS; } diff --git a/src/join.c b/src/join.c index 7c75c76..e2ba02b 100644 --- a/src/join.c +++ b/src/join.c @@ -1193,7 +1193,7 @@ main (int argc, char **argv) die (EXIT_FAILURE, errno, "%s", quotef (g_names[1])); if (issued_disorder_warning[0] || issued_disorder_warning[1]) - return EXIT_FAILURE; + error (EXIT_FAILURE, 0, _("input is not in sorted order")); else return EXIT_SUCCESS; } From unknown Mon Jun 16 23:47:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 10 Mar 2019 11:24:04 +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