From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 02:45:43 2023 Received: (at submit) by debbugs.gnu.org; 4 Feb 2023 07:45:43 +0000 Received: from localhost ([127.0.0.1]:40543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODEz-00065n-7a for submit@debbugs.gnu.org; Sat, 04 Feb 2023 02:45:42 -0500 Received: from lists.gnu.org ([209.51.188.17]:47162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pO4aP-0005Xq-Om for submit@debbugs.gnu.org; Fri, 03 Feb 2023 17:31:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO4aP-0002qY-Hu for bug-coreutils@gnu.org; Fri, 03 Feb 2023 17:31:13 -0500 Received: from bije.zone ([199.180.249.134] helo=mail.bije.zone) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO4aN-0007R0-Gb for bug-coreutils@gnu.org; Fri, 03 Feb 2023 17:31:13 -0500 Received: from localhost (NAT-1750-N9-1.naszasiec.net [46.22.166.160]) by mail.bije.zone (Postfix) with ESMTPSA id B9587B48 for ; Fri, 3 Feb 2023 16:31:08 -0600 (CST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 03 Feb 2023 23:31:06 +0100 Message-Id: Subject: shuf -i with negative numbers From: To: X-Mailer: aerc 0.14.0 Received-SPF: pass client-ip=199.180.249.134; envelope-from=kpm@plan9.lol; helo=mail.bije.zone X-Spam_score_int: 0 X-Spam_score: -0.0 X-Spam_bar: / X-Spam_report: (-0.0 / 5.0 requ) BAYES_20=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 04 Feb 2023 02:45:39 -0500 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.4 (--) hello shuf -i option cannot handle negative numbers. examples: $ shuf -i -10-20 $ shuf -i 0--20 don't know if it's a bug or a feature. :^) ~ kpm From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 04 07:09:36 2023 Received: (at 61267) by debbugs.gnu.org; 4 Feb 2023 12:09:36 +0000 Received: from localhost ([127.0.0.1]:40804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOHMO-0003vI-4r for submit@debbugs.gnu.org; Sat, 04 Feb 2023 07:09:36 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:53062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pOHML-0003v1-9w; Sat, 04 Feb 2023 07:09:34 -0500 Received: by mail-wm1-f49.google.com with SMTP id k16so5638514wms.2; Sat, 04 Feb 2023 04:09:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=SqphxIO59mdNlPbRtIN1ix1tGDnBLKlJFmisWqj4huQ=; b=ZB/dYrJBRSizxb5//YGLgZ3u6o0CfhQTIvlXHgE4DD1ORwJzJJvsTWXycPiL+NtGCl FdulgAd0pWEqoY9cyC6BvLlg1PLabEDNFZlPkqGQV3TJ1w1PorWfOy1yItTJoHyU//n/ kfVm7lGHPVf3caQjCPkHWm5em3S+kLkA9vyj5K6LSQNGvca+Wa2xNhcaPET87+EW1A7m t9Ppml5WLoUbBvSpIpq+k/YpSQm2Dlm5LFk8VStvwgkcyawZzVuMSnJLvysEJxtspIDx vEGOiwlT+v66wCxH+XPyTn2BkZDQagp7mhaC1H8qHWKC6koPakujom9li9b/C0wLYKQR taCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SqphxIO59mdNlPbRtIN1ix1tGDnBLKlJFmisWqj4huQ=; b=kzRBp9kl+L1JXbR6F329BGITfLTxu0Vo7BYNT2D3J103efNoC+lypucLkpB8Sb6BsL IOMwO8QAP+YlKdnTMNpM5g2jY4nnHlz5rhgfYLsswCmUgaTGG8noZ+/p62K6+/g5blMB w8ldNdaYCh0V7Of2PXhcNbrNPwVZN5jQ3vToHsWoQu+rdf2k0O0hjY0LF3BeeyGkaAFt wAn47RM9p9v0NVXlVWkLfdDQZX58PKcI20a9SYgTs1O13WXTMmYt5U45uts4gEe15DZu GlpRrTRC+7E2ELLbMxgERjg9svjyYCqO+tM6rvPdlJru9SZqzZ7m7Lo1UhruMblCDuWh q4NA== X-Gm-Message-State: AO0yUKWyLPHcCeWcXbjMjd/KFIMyPA/YRBG86i7l16IpQB/a9o2ZStwh vGSblk0RjL/usB81ShRrA0DCsL2buFc= X-Google-Smtp-Source: AK7set+MUDqBdUx0XDtEDLPAXu7Hs4XN3VUDxzfGr1PVFsjgidec1MGuqD+eJwCblIazT1ntpUTmTw== X-Received: by 2002:a05:600c:3b23:b0:3dc:5a0b:d256 with SMTP id m35-20020a05600c3b2300b003dc5a0bd256mr12601365wms.22.1675512567336; Sat, 04 Feb 2023 04:09:27 -0800 (PST) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id o37-20020a05600c512500b003c6bbe910fdsm11735591wms.9.2023.02.04.04.09.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Feb 2023 04:09:26 -0800 (PST) Message-ID: Date: Sat, 4 Feb 2023 12:09:25 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0 Subject: Re: bug#61267: shuf -i with negative numbers Content-Language: en-US To: kpm@plan9.lol, 61267@debbugs.gnu.org References: From: =?UTF-8?Q?P=C3=A1draig_Brady?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 61267 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.9 (-) tag 61267 notabug close 61267 stop comments below... On 03/02/2023 22:31, kpm@plan9.lol wrote: > hello > > shuf -i option cannot handle negative numbers. > examples: > $ shuf -i -10-20 > $ shuf -i 0--20 > > don't know if it's a bug or a feature. The input range needs to be unsigned as documented in the info manual. It should be easy enough to shift to the desired range, for example: $ shiftn() { sed "s/\$/$1/" | bc; } $ shuf -i 0-10 | shiftn -5 3 -2 0 5 2 -5 4 -1 -3 1 -4 cheers, Pádraig From unknown Tue Aug 19 21:02:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 04 Mar 2023 12:24:15 +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