From unknown Wed Jun 18 00:25:46 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#49217 <49217@debbugs.gnu.org> To: bug#49217 <49217@debbugs.gnu.org> Subject: Status: 'shuf' returns nothing if the low range number is higher by 1 than the high number Reply-To: bug#49217 <49217@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:25:46 +0000 retitle 49217 'shuf' returns nothing if the low range number is higher by 1= than the high number reassign 49217 coreutils submitter 49217 F8ER F8ER severity 49217 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 00:13:24 2021 Received: (at submit) by debbugs.gnu.org; 25 Jun 2021 04:13:24 +0000 Received: from localhost ([127.0.0.1]:44449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwdDX-0007zL-JP for submit@debbugs.gnu.org; Fri, 25 Jun 2021 00:13:24 -0400 Received: from lists.gnu.org ([209.51.188.17]:57184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwZ3U-0001Al-UF for submit@debbugs.gnu.org; Thu, 24 Jun 2021 19:46:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwZ3U-0005lR-CI for bug-coreutils@gnu.org; Thu, 24 Jun 2021 19:46:44 -0400 Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]:35455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwZ3S-0000Ie-OZ for bug-coreutils@gnu.org; Thu, 24 Jun 2021 19:46:44 -0400 Received: by mail-yb1-xb2e.google.com with SMTP id i4so1914843ybe.2 for ; Thu, 24 Jun 2021 16:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=2GOmkOa7LMtRXm+5Q6QXMURxPg9WILVEamBPmlq555c=; b=MhY+1JxOTk7nfnXbLXrHD0QV/z2ju59nr2i5aUBNZAKWeTwo9E69I8OOlOAWqEug4Q AWmPpOv2wzpXhMknOQhLEGn29x905nrf8ihV3Kaor3jjpxyxn59/Oxi0ybF+vZDIEZJe O9A/cjRWs4QsEwAqdeUHFovpsRcdiMGpWWyG49c63cjqKUKittgrB2qrt6PiSbLZKnCp O3K+CdC83mNquvF6e7KrbRD4ayFYWv/r6vVaFTFUuZ2L4hk396/oGkq4W82Ah3p8So3H djFkmb1ldrGRd14w1/geuHUVGfO/fU5Jp81Xm2WQo6xJTIs/qCzJ2m/sxDyLSqojPF0J Lg4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2GOmkOa7LMtRXm+5Q6QXMURxPg9WILVEamBPmlq555c=; b=q8hrvB4GQTJrkoT0IOFHIgvHo7n2eflp33fHOXYO/WjB/a9W+TYrrJ3XDDtnRgQBLZ IkKaifUeNHP5B7EJUcebZ9ABHSh9ltFPblcnkRwoXbMRI91eJNXRLrWQhNQlxf5gGCUO IueH8WQ4V2+PLrrFZb0/HAm7xU01LvUg+/umhKdWd1fBIOFOSBIBXr1Snk7qjdAmLB7k dG2c4OeDJWlxvGKI7ziM6zvIoO9wfWzuRjPeL9tbAbLajaFCINrkpcZiDUFDbbn0AfTK zA1OY8Mn/D88tu+mCXcaUdRSjSDEIeFBL2QgSd22FLmjNowY2Gj2BcCu3GUPU0oxyt6q z9sQ== X-Gm-Message-State: AOAM530UFTzNAx7R9VIWSr0JSvtCQPV7uKE4/JgRE3pBpIiibEnW3+rD KLPLz0CVuTXsE0syhCMc6g5UZt1k/Kvpl73cOUKj6tzCXIs= X-Google-Smtp-Source: ABdhPJziuUzprSPVFoKwYKPKittNKF8gC9PA7c0k5xPeDSy0ojM0XcfyZQ9NVpCV44ehGiHVDY1djTErzE2/NlpQmpo= X-Received: by 2002:a25:2315:: with SMTP id j21mr8310831ybj.37.1624578401232; Thu, 24 Jun 2021 16:46:41 -0700 (PDT) MIME-Version: 1.0 From: F8ER F8ER Date: Fri, 25 Jun 2021 01:46:30 +0200 Message-ID: Subject: 'shuf' returns nothing if the low range number is higher by 1 than the high number To: bug-coreutils@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::b2e; envelope-from=the.f8er@gmail.com; helo=mail-yb1-xb2e.google.com X-Spam_score_int: 13 X-Spam_score: 1.3 X-Spam_bar: + X-Spam_report: (1.3 / 5.0 requ) BAYES_60=1.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 25 Jun 2021 00:13:22 -0400 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: -2.3 (--) Dear GNU Developers, Thank you very much for the project. It seems, if the low range number is higher by 1 than the high number, the program returns nothing (with exit code = 0), while 102-100 results in an error and 100-100 returns 100 as expected. For example, `shuf -i 101-100 -n 1` returns nothing with the exit code = 0 (unexpected). Expected (normal): `shuf -i 100-101 -n 1` returns either 100 or 101 with an exit code = 0. `shuf -i 100-100 -n 1` returns 100 with an exit code = 0. `shuf -i 102-100 -n 1` results in an error with an exit code = 1. Is that an expected behavior? Stay safe! Best and kind regards From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 00:19:43 2021 Received: (at 49217-done) by debbugs.gnu.org; 25 Jun 2021 04:19:43 +0000 Received: from localhost ([127.0.0.1]:44471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwdJf-0008CE-In for submit@debbugs.gnu.org; Fri, 25 Jun 2021 00:19:43 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:39834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwdJe-0008C2-Gm for 49217-done@debbugs.gnu.org; Fri, 25 Jun 2021 00:19:42 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 15F541600F7; Thu, 24 Jun 2021 21:19:37 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id VwCjjllx0owv; Thu, 24 Jun 2021 21:19:36 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 700661600CC; Thu, 24 Jun 2021 21:19:36 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jxxLP51ewrwb; Thu, 24 Jun 2021 21:19:36 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 4CA241600C2; Thu, 24 Jun 2021 21:19:36 -0700 (PDT) Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number To: F8ER F8ER References: From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> Date: Thu, 24 Jun 2021 21:19:36 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217-done Cc: 49217-done@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: -3.3 (---) On 6/24/21 4:46 PM, F8ER F8ER wrote: > For example, `shuf -i 101-100 -n 1` returns nothing with the exit code > = 0 (unexpected). Actually, it's the expected behavior. It's the same behavior as 'shuf -n 1 ) id 1lwffX-0004LL-Dx for submit@debbugs.gnu.org; Fri, 25 Jun 2021 02:50:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:59810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwffV-0004LE-U5 for submit@debbugs.gnu.org; Fri, 25 Jun 2021 02:50:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwffV-0004eb-It for bug-coreutils@gnu.org; Fri, 25 Jun 2021 02:50:25 -0400 Received: from mailgw1.uni-kl.de ([2001:638:208:120::220]:35523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwffS-00070K-4j for bug-coreutils@gnu.org; Fri, 25 Jun 2021 02:50:25 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15P6nqrG127712 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Jun 2021 08:49:52 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15P6npJF014893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 25 Jun 2021 08:49:52 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15P6npTv014892; Fri, 25 Jun 2021 08:49:51 +0200 Date: Fri, 25 Jun 2021 08:49:51 +0200 From: Erik Auerswald To: bug-coreutils@gnu.org Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number Message-ID: <20210625064951.GA13531@unix-ag.uni-kl.de> Mail-Followup-To: Erik Auerswald , bug-coreutils@gnu.org, 49217@debbugs.gnu.org, eggert@cs.ucla.edu, the.f8er@gmail.com References: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO Received-SPF: none client-ip=2001:638:208:120::220; envelope-from=auerswal@unix-ag.uni-kl.de; helo=mailgw1.uni-kl.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: 49217@debbugs.gnu.org, eggert@cs.ucla.edu, the.f8er@gmail.com 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: -3.3 (---) Hi, On Thu, Jun 24, 2021 at 09:19:36PM -0700, Paul Eggert wrote: > On 6/24/21 4:46 PM, F8ER F8ER wrote: > >For example, `shuf -i 101-100 -n 1` returns nothing with the exit code > >= 0 (unexpected). > > Actually, it's the expected behavior. It's the same behavior as > 'shuf -n 1 exactly 1 line"; it means "output at most 1 line". I think the reported issue is with producing no error with LO==HI+1, but producing an error with LO) id 1lwfji-0004SV-Hu for submit@debbugs.gnu.org; Fri, 25 Jun 2021 02:54:46 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:58332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwfjg-0004SN-OK for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 02:54:45 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15P6shiw129995 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 08:54:43 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15P6shpg015648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 08:54:43 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15P6shSN015647 for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 08:54:43 +0200 Date: Fri, 25 Jun 2021 08:54:43 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number Message-ID: <20210625065443.GB13531@unix-ag.uni-kl.de> References: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> <20210625064951.GA13531@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625064951.GA13531@unix-ag.uni-kl.de> Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) Hi, On Fri, Jun 25, 2021 at 08:49:51AM +0200, Erik Auerswald wrote: > On Thu, Jun 24, 2021 at 09:19:36PM -0700, Paul Eggert wrote: > > On 6/24/21 4:46 PM, F8ER F8ER wrote: > > >For example, `shuf -i 101-100 -n 1` returns nothing with the exit code > > >= 0 (unexpected). > > > > Actually, it's the expected behavior. It's the same behavior as > > 'shuf -n 1 > exactly 1 line"; it means "output at most 1 line". > > I think the reported issue is with producing no error with LO==HI+1, > but producing an error with LOHI+1 Sorry! Thanks, Erik -- Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 09:23:37 2021 Received: (at 49217) by debbugs.gnu.org; 25 Jun 2021 13:23:37 +0000 Received: from localhost ([127.0.0.1]:45147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwlo1-00043Q-Dj for submit@debbugs.gnu.org; Fri, 25 Jun 2021 09:23:37 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:47425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwlnz-00043I-Mj for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 09:23:36 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15PDNY2s170122 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 15:23:34 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15PDNXE4028152 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 15:23:33 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15PDNXiM028151 for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 15:23:33 +0200 Date: Fri, 25 Jun 2021 15:23:33 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: [PATCH] shuf: fix bug with "-i 1-0" Message-ID: <20210625132333.GA27894@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-0.999, tests=ALL_TRUSTED=-1,URIBL_BLOCKED=0.001 X-Spam-Score: (-0.999) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) "shuf -i 1-0" would mistakenly accept the invalid range without an error message and produce no output. Other invalid ranges, e.g., "shuf -i 2-0", would be detected and produce an error message, non-zero exit code, and no output. Bug reported by "F8ER F8ER." * src/shuf.c (main): Fix bug. * tests/misc/shuf.sh: Add a test case for the bug. --- src/shuf.c | 2 +- tests/misc/shuf.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shuf.c b/src/shuf.c index 1af1b533a..91430a88a 100644 --- a/src/shuf.c +++ b/src/shuf.c @@ -431,7 +431,7 @@ main (int argc, char **argv) _("invalid input range"), 0); n_lines = hi_input - lo_input + 1; - invalid |= ((lo_input <= hi_input) == (n_lines == 0)); + invalid |= (lo_input > hi_input); if (invalid) die (EXIT_FAILURE, errno, "%s: %s", _("invalid input range"), quote (optarg)); diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index 892386b3f..2a7cba4d3 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -95,7 +95,7 @@ test "$c" -eq 3 || { fail=1; echo "Multiple -n failed">&2 ; } { shuf -i0-9 -n10 -i8-90 || test $? -ne 1; } && { fail=1; echo "shuf did not detect multiple -i usage.">&2 ; } # Test invalid range -for ARG in '1' 'A' '1-' '1-A'; do +for ARG in '1' 'A' '1-' '1-A' '1-0' '2-0'; do { shuf -i$ARG || test $? -ne 1; } && { fail=1; echo "shuf did not detect erroneous -i$ARG usage.">&2 ; } done -- 2.17.1 From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 10:47:27 2021 Received: (at 49217) by debbugs.gnu.org; 25 Jun 2021 14:47:27 +0000 Received: from localhost ([127.0.0.1]:46604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwn79-0004L6-Jh for submit@debbugs.gnu.org; Fri, 25 Jun 2021 10:47:27 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:56991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwn78-0004JN-IL for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 10:47:27 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15PElOAw017282 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 16:47:24 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15PElOdW010650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 16:47:24 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15PElOab010649 for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 16:47:24 +0200 Date: Fri, 25 Jun 2021 16:47:24 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number Message-ID: <20210625144724.GA9539@unix-ag.uni-kl.de> References: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> <20210625064951.GA13531@unix-ag.uni-kl.de> <20210625065443.GB13531@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625065443.GB13531@unix-ag.uni-kl.de> Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) Hi, On Fri, Jun 25, 2021 at 08:54:43AM +0200, Erik Auerswald wrote: > On Fri, Jun 25, 2021 at 08:49:51AM +0200, Erik Auerswald wrote: > > On Thu, Jun 24, 2021 at 09:19:36PM -0700, Paul Eggert wrote: > > > On 6/24/21 4:46 PM, F8ER F8ER wrote: > > > >For example, `shuf -i 101-100 -n 1` returns nothing with the exit code > > > >= 0 (unexpected). > > > > > > Actually, it's the expected behavior. It's the same behavior as > > > 'shuf -n 1 > > exactly 1 line"; it means "output at most 1 line". > > > > I think the reported issue is with producing no error with LO==HI+1, > > but producing an error with LO ^ > LO>HI+1 The code seems to intentionally silently ignore LO == HI+1, but not LO > HI+1. But this is neither documented nor tested. This may be an intentionally interesting way to simulate reading from an empty file containing no lines between LO and HI. Please see my previous patch as a suggestion on how to make the code less suprising. I am fine with keeping the current behavior, but then I'd like to document it and add test cases. Please let me know if you'd rather have a documentation change & tests patch than the current code change & tests patch. I do think that it would be better to either change the code or the documentation, and add test cases, than to do nothing. Thanks, Erik -- Simplicity is prerequisite for reliability. -- Edsger W. Dijkstra From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 12:29:13 2021 Received: (at submit) by debbugs.gnu.org; 25 Jun 2021 16:29:13 +0000 Received: from localhost ([127.0.0.1]:46685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwohc-00011p-QE for submit@debbugs.gnu.org; Fri, 25 Jun 2021 12:29:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:48350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwohb-00011d-Oo for submit@debbugs.gnu.org; Fri, 25 Jun 2021 12:29:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwohb-0006nT-Ea for bug-coreutils@gnu.org; Fri, 25 Jun 2021 12:29:11 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwohZ-00017h-E6 for bug-coreutils@gnu.org; Fri, 25 Jun 2021 12:29:10 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AC9221600AF; Fri, 25 Jun 2021 09:29:05 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 5SGjiUlOIACE; Fri, 25 Jun 2021 09:29:05 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0786D1600C2; Fri, 25 Jun 2021 09:29:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id nXhBoQCOxspd; Fri, 25 Jun 2021 09:29:04 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CE6A01600AF; Fri, 25 Jun 2021 09:29:04 -0700 (PDT) To: Erik Auerswald , bug-coreutils@gnu.org, 49217@debbugs.gnu.org, the.f8er@gmail.com References: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> <20210625064951.GA13531@unix-ag.uni-kl.de> From: Paul Eggert Organization: UCLA Computer Science Department Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number Message-ID: Date: Fri, 25 Jun 2021 09:29:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210625064951.GA13531@unix-ag.uni-kl.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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: -2.3 (--) On 6/24/21 11:49 PM, Erik Auerswald wrote: > $ shuf -i 2-0 ; echo %exit code $? > shuf: invalid input range: =E2=80=982-0=E2=80=99 > %exit code 1 > $ shuf -i 1-0 ; echo %exit code $? > %exit code 0 >=20 > This looks inconsistent and possibly not exactly as intended. It's exactly what I intended and there's no inconsistency. When you say=20 'shuf -i M-N' you select from a collection of N-M+1 lines. N-M+1 =3D 0 (n= o=20 input lines) makes sense, but N-M+1 < 0 (negative number of input=20 lines?) does not. > I'd like to document it and add test cases. Feel free, though we need to reserve the right to extend 'shuf' in the=20 future. In other words, not every invocation of 'shuf' that provokes a=20 diagnostic now will provoke a diagnostic in the future. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 25 14:00:18 2021 Received: (at 49217) by debbugs.gnu.org; 25 Jun 2021 18:00:18 +0000 Received: from localhost ([127.0.0.1]:46759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwq7m-0003Pj-Iv for submit@debbugs.gnu.org; Fri, 25 Jun 2021 14:00:18 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:43556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lwq7j-0003PX-GV for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 14:00:17 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15PI0DeS102739 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 20:00:13 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15PI0DKu001502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Fri, 25 Jun 2021 20:00:13 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15PI0Dgr001499 for 49217@debbugs.gnu.org; Fri, 25 Jun 2021 20:00:13 +0200 Date: Fri, 25 Jun 2021 20:00:13 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: Re: bug#49217: 'shuf' returns nothing if the low range number is higher by 1 than the high number Message-ID: <20210625180013.GA28691@unix-ag.uni-kl.de> References: <8ae9edf4-7e65-847a-bfb9-8074853810e4@cs.ucla.edu> <20210625064951.GA13531@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) Hi Paul, On Fri, Jun 25, 2021 at 09:29:04AM -0700, Paul Eggert wrote: > On 6/24/21 11:49 PM, Erik Auerswald wrote: > > $ shuf -i 2-0 ; echo %exit code $? > > shuf: invalid input range: ‘2-0’ > > %exit code 1 > > $ shuf -i 1-0 ; echo %exit code $? > > %exit code 0 > > > >This looks inconsistent and possibly not exactly as intended. > > It's exactly what I intended and there's no inconsistency. When you > say 'shuf -i M-N' you select from a collection of N-M+1 lines. It also specifies the contents of those lines, unless there is less than one line. > N-M+1 = 0 (no input lines) makes sense, but N-M+1 < 0 (negative number > of input lines?) does not. I do not think that it makes sense to specify the contents of no input lines. Perhaps we can agree to disagree on this? Then the documentation does not describe it that way. I think that can lead to confusion. The documentation describes the option as simulating input "from a file containing the range of unsigned decimal integers LO...HI, one per line." >From this description it is not obvious that "1-0" is OK, but "2-0" is not. In both cases LO > HI, but one is accepted without error, but the other is not. I think that "select from a negative number of lines" makes just as much sense as "select from no lines at all." Here we seem to disagree, which is OK with me. Similarly to "shuf -iLO-HI", "seq FIRST LAST" produces LAST-FIRST+1 lines. But seq does allow to ask, to adapt your wording, for a negative number of lines: $ seq 2 0 ; echo %exit code $? %exit code 0 $ seq 1 0 ; echo %exit code $? %exit code 0 $ seq 0 0 ; echo %exit code $? 0 %exit code 0 The problem I see is that the intention behind "shuf -i" that can be gleaned from your implementation, and that you have described above, is not obvious from the documentation or from similar functionality in the GNU Core Utilities. I see three views regarding the case of LO > HI in this thread: 1. The bug reporter expected LO > HI to always produce an error, or possibly to never produce an error. 2. Your "shuf" implementation sees LO == HI+1 as the one allowed possibility to specify no input, based on the HI-LO+1 formula for the number of lines to choose from. 3. The "seq" implementation in the GNU Core Utilities allows LO > HI and interprets it as the empty sequence. I actually like this best. Thus I think that it is not as clear and obvious as you seem to expect that the current "shuf" behavior is the obviously correct one. No offense intended! I do not care deeply which behavior is selected. I just want to make it clearer for others, including me, to understand that the current implementation is as intended. Adding to the documentation (for users) and the tests (for developers) seems to be helpful to me. > >I'd like to document it and add test cases. > > Feel free, Thanks, I'll think about a wording both simple to understand and including the special case. I intend to send a patch to this bug report in a couple of days. > though we need to reserve the right to extend 'shuf' in > the future. In other words, not every invocation of 'shuf' that > provokes a diagnostic now will provoke a diagnostic in the future. I like that. HTH, HAND, Erik -- Be water, my friend. -- Bruce Lee From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 13:01:51 2021 Received: (at 49217) by debbugs.gnu.org; 26 Jun 2021 17:01:51 +0000 Received: from localhost ([127.0.0.1]:48575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBgl-0006bV-5n for submit@debbugs.gnu.org; Sat, 26 Jun 2021 13:01:51 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:55767) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBgj-0006bF-9J for 49217@debbugs.gnu.org; Sat, 26 Jun 2021 13:01:50 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15QH1lHH053692 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Sat, 26 Jun 2021 19:01:47 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15QH1koS008365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Sat, 26 Jun 2021 19:01:47 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15QH1kBF008364 for 49217@debbugs.gnu.org; Sat, 26 Jun 2021 19:01:46 +0200 Date: Sat, 26 Jun 2021 19:01:46 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: [PATCH] doc: clarify valid ranges for shuf -i Message-ID: <20210626170146.GA8248@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-1, tests=ALL_TRUSTED=-1 X-Spam-Score: (-1) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) * doc/coreutils.texi (shut invocation): Mention valid and invalid edge cases for --input-range. --- doc/coreutils.texi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index ea040458e..f59c5e962 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4978,7 +4978,10 @@ Treat each command-line operand as an input line. @opindex --input-range @cindex input range to shuffle Act as if input came from a file containing the range of unsigned -decimal integers @var{lo}@dots{}@var{hi}, one per line. +decimal integers @var{lo}@dots{}@var{hi}, one per line. If @var{lo} is +equal to @var{hi}, this is a single line. If @var{lo} is one bigger than +@var{hi}, this is accepted as the empty range. Other cases of @var{lo} +greater than @var{hi} are rejected as invalid. @end table -- 2.17.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 26 13:02:28 2021 Received: (at 49217) by debbugs.gnu.org; 26 Jun 2021 17:02:28 +0000 Received: from localhost ([127.0.0.1]:48579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBhM-0006cy-D4 for submit@debbugs.gnu.org; Sat, 26 Jun 2021 13:02:28 -0400 Received: from mailgw1.uni-kl.de ([131.246.120.220]:55820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxBhK-0006cq-Ob for 49217@debbugs.gnu.org; Sat, 26 Jun 2021 13:02:27 -0400 Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de [IPv6:2001:638:208:ef34:0:ff:fe00:65]) by mailgw1.uni-kl.de (8.14.4/8.14.4/Debian-8+deb8u2) with ESMTP id 15QH2N5b053956 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <49217@debbugs.gnu.org>; Sat, 26 Jun 2021 19:02:23 +0200 Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1]) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id 15QH2NVA008411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for <49217@debbugs.gnu.org>; Sat, 26 Jun 2021 19:02:23 +0200 Received: (from auerswal@localhost) by sushi.unix-ag.uni-kl.de (8.14.4/8.14.4/Submit) id 15QH2Nlk008410 for 49217@debbugs.gnu.org; Sat, 26 Jun 2021 19:02:23 +0200 Date: Sat, 26 Jun 2021 19:02:23 +0200 From: Erik Auerswald To: 49217@debbugs.gnu.org Subject: [PATCH] tests: exercise shuf --input-range edge cases Message-ID: <20210626170223.GA8373@unix-ag.uni-kl.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Author: Erik Auerswald User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, hits=-0.999, tests=ALL_TRUSTED=-1,URIBL_BLOCKED=0.001 X-Spam-Score: (-0.999) X-Spam-Flag: NO X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49217 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: -3.3 (---) * tests/misc/shuf.sh: Test valid "shuf -i" edge cases that result in a single line of input, or no line at all. Test an invalid range, too. --- tests/misc/shuf.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh index 892386b3f..83e940ec4 100755 --- a/tests/misc/shuf.sh +++ b/tests/misc/shuf.sh @@ -39,6 +39,15 @@ compare in out > /dev/null && { fail=1; echo "not random?" 1>&2; } sort -n out > out1 compare in out1 || { fail=1; echo "not a permutation" 1>&2; } +# Exercise border conditions of shuf's -i option +# LO == HI gives one line +echo 1 > in1 || framework_failure_ +shuf -i 1-1 > out || fail=1 +compare in1 out || fail=1 +# LO == HI+1 gives no output +shuf -i 1-0 > out || fail=1 +compare /dev/null out || fail=1 + # Exercize shuf's -r -n 0 options, with no standard input. shuf -r -n 0 in <&- >out || fail=1 compare /dev/null out || fail=1 @@ -95,7 +104,7 @@ test "$c" -eq 3 || { fail=1; echo "Multiple -n failed">&2 ; } { shuf -i0-9 -n10 -i8-90 || test $? -ne 1; } && { fail=1; echo "shuf did not detect multiple -i usage.">&2 ; } # Test invalid range -for ARG in '1' 'A' '1-' '1-A'; do +for ARG in '1' 'A' '1-' '1-A' '3-1'; do { shuf -i$ARG || test $? -ne 1; } && { fail=1; echo "shuf did not detect erroneous -i$ARG usage.">&2 ; } done -- 2.17.1 From unknown Wed Jun 18 00:25:46 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, 25 Jul 2021 11:24:05 +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