From unknown Mon Jun 23 02:26:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39135: Globbing with numbers does not allow me to specify order Resent-From: Antti Savolainen Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 14 Jan 2020 15:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39135 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 39135@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157901576117579 (code B ref -1); Tue, 14 Jan 2020 15:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2020 15:29:21 +0000 Received: from localhost ([127.0.0.1]:33417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irO85-0004ZN-Ht for submit@debbugs.gnu.org; Tue, 14 Jan 2020 10:29:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:36565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irHog-0000g6-U3 for submit@debbugs.gnu.org; Tue, 14 Jan 2020 03:44:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irHof-0005Is-PL for bug-coreutils@gnu.org; Tue, 14 Jan 2020 03:44:50 -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 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irHoe-0003Ee-Rf for bug-coreutils@gnu.org; Tue, 14 Jan 2020 03:44:49 -0500 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:43291) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irHoe-0003EK-N5 for bug-coreutils@gnu.org; Tue, 14 Jan 2020 03:44:48 -0500 Received: by mail-ot1-x32d.google.com with SMTP id p8so11835888oth.10 for ; Tue, 14 Jan 2020 00:44:48 -0800 (PST) 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=U9QyyABXB/ztnFJ6wBzC3FSjkqPvMydC6T8WTBgK8us=; b=F4GTTOt1+g4YYS55IwMO0ao7npV73WAOeQbaaGKT86axAbJGDnQWRDXFN8CI81UvAi QlgZROpogIlQXHzWyyvNFFA36XHpDSh73dBbhPxm9LO0q2R//lilpyDuaDlng2e14P0D CU3DMa2o68TqU0yRP25dYttjpi/QKL1SvBdNVyQk1N020Ew6kPhcmf8fcaYth+CUr3vq eB2vslTwB5dRVXyFh9qQkNHc/XvEH6h2amIWQHuR233PvIqQq4E5YaC69qNMfqhADUOV ztrOCVFEQ036majcjss3S+vTMn1Zwa7TD8yBlMTV9fjKsCRNTpY2GcEr7LWBSIA7q9rx XZYQ== 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=U9QyyABXB/ztnFJ6wBzC3FSjkqPvMydC6T8WTBgK8us=; b=UsbAoVPdhrdm9fVQyrjwHTrIIfMLTCBZdiX50+4mc0Rxnk77KvG1t2veCaN+pwQ4cE cYXJS0vgJd0FQ0CZoZixR+geRpY5lfaVu8eRwEo7fcPj0WRyoM2lNsPYfunoqERY75XG +cv3NKCtUnQtB9pILjhGlW01ILHWMPyP1oiHFC3r083X4X2EeS802XOtrxo2xmb6aUhL 0VKU+f3lRDRMplEnY8MXrjYzCflcZABNyZ5lKQZ43JDzy0ZeUwEi2D3/jiVRSmdjQGec zAWbqS/y1uTYaMsa2zQ6okV4GB09S647vmzz+2szaBhwIy1y1mEd36v0RK/qAoW1luou bOPw== X-Gm-Message-State: APjAAAWx+yoEpAdpdb5PPFm2XaHrXaKlGG5IAc7oFFiGNLVG2ZGKuSqQ wu0fF7RFnCpNyEMaBIVVylno8XLPhbXMIqoicQlPfRzO X-Google-Smtp-Source: APXvYqzo3MWC0wEfnwTcBRsX/jsb+JKZeIa5gx4Zha0gK7fTsPmRRUrEILFxDhdTxeX2h4AKyKy6ucWaTeyFRI6uFk4= X-Received: by 2002:a9d:6758:: with SMTP id w24mr17374931otm.155.1578991486482; Tue, 14 Jan 2020 00:44:46 -0800 (PST) MIME-Version: 1.0 From: Antti Savolainen Date: Tue, 14 Jan 2020 10:44:21 +0200 Message-ID: Content-Type: multipart/alternative; boundary="000000000000a7be8a059c159a8c" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32d X-Spam-Score: 0.7 (/) X-Mailman-Approved-At: Tue, 14 Jan 2020 10:29:16 -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.3 (--) --000000000000a7be8a059c159a8c Content-Type: text/plain; charset="UTF-8" When doing a shortcut to unmount in a specific order, I am unable to specify order with angle brackets. For example using 'umount /dev/sda[132]' will result in the system unmounting them in numerological order. First 1 then 2 and finally 3. What I need it to do is to first unmount 1, then 3 and finally 2. It would be nice for the glob to respect the order of numbers that it was given. --000000000000a7be8a059c159a8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When doing a shortcut to unmount in a specific order, I am= unable to specify order with angle brackets. For example using 'umount= /dev/sda[132]' will result in the system unmounting them in numerologi= cal order. First 1 then 2 and finally 3. What I need it to do is to first u= nmount 1, then 3 and finally 2. It would be nice for the glob to respect th= e order of numbers that it was given.
--000000000000a7be8a059c159a8c-- From unknown Mon Jun 23 02:26:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39135: Globbing with numbers does not allow me to specify order Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 14 Jan 2020 21:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39135 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Antti Savolainen , 39135@debbugs.gnu.org Received: via spool by 39135-submit@debbugs.gnu.org id=B39135.157903700626991 (code B ref 39135); Tue, 14 Jan 2020 21:24:02 +0000 Received: (at 39135) by debbugs.gnu.org; 14 Jan 2020 21:23:26 +0000 Received: from localhost ([127.0.0.1]:33688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irTen-00071B-Ts for submit@debbugs.gnu.org; Tue, 14 Jan 2020 16:23:26 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:50863) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irTel-00070n-DC; Tue, 14 Jan 2020 16:23:24 -0500 Received: from [192.168.101.10] ([93.218.97.181]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1My3Mv-1jaVEh0YxD-00zWz1; Tue, 14 Jan 2020 22:23:16 +0100 References: From: Bernhard Voelker Autocrypt: addr=mail@bernhard-voelker.de; prefer-encrypt=mutual; keydata= mQENBFPirzMBCACyzYldTjQ4ufFOkByY5Nn5USb5GFoL48nWBwNHjd9KUbtRRNlQiPNKd6hK Gvd3BGi5aoFKA4ytfRk6jbAbW3jVb3R8wYaV08mOy4KVEKxqN4bxsXlMjNChXVR+rtKDmfI+ oPTL+cPH2X6gW4W02IRbVw0uUhNm6zEedC/gNrY/mTlf1enZ46jxZ7BTUZaG+kx38UMISIMB zSzLRtdkwgmHj4jS3p1fF2cwRqLclIfMjKGpbNFPEXeXKWrCLcqHw78795eAR9q0Yv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3Fb+if CzR9qeQF82fMSxkg18++7hMcHCMO/hPZ/Q0xRi+lrSr2QKDJQuLzSyVU14TxrCkevZjEhtma VNvcJlJzCbiBXee9Fpc5jITUXPFG8E8dxqo1n+duOyIMgozrAnzP7X5V/Ob/Ozf/aGGX9+Jd inyfCX18nWcHALKMU/36Eua/ylalf/2c2YkBp9KCLVmGgPkUgW52EeRPgroIsiwu+rwCSV6Z UyCJ+OymCg== Message-ID: <4436a3bf-d39a-5321-0fac-164affb895e8@bernhard-voelker.de> Date: Tue, 14 Jan 2020 22:23:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:k0+u7xLndQ3LAMuLvSuoZh0XhlIZ1+Ns8HUxEsh0Pd84Piv99Kf mdTDgjG5vA5UOr4/7a7i8Bqz3068fur/FwbFXpfM6kzttn2MwR3tmISMCen/56I2iro6j+K cwLBYczAwhnhYgo9tlr5V00AmAURpEE3O/SqTYbF0/EuuYjt68h1kaPIQYBVO/ompbpxp57 INgb0D1zK1Ext9frweUsw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:u7pn+tQYIPE=:e0RIkktfV5iwFUfvk7kLZh 4NgzC0yMiYhFFebBF+lBSNvuyns/vc54Fx/J3oicLfvLD2chHtkX3jUNaiyhC9MssQZIfRgPH SJvgTyCm8WyeLNmFAE7uOM6Mz0308byGiFZhvVTEzuQv3d8r3ROvyLO8MVSJFRRJwtTcWGSqF 2XsRyZ6irDYAK3a8wZ3pY7Y/ZceIJR+pVGQE2wNGLtfa92M5gNbBAKNw5zhNJXJoNCM2Pl0Qu PxgO93OcC/Pj/kDirFNKpVQBwwQlR9XMBwCwRBz7RJZ75fNAQ+QFqcB+Cd3W1MPV/LcuiHJ1y i5ZIQF+/heaYq5QsL78N4C8UP9vF5dADEpXXTUb0zzkLtVzsQKRY7YulEVZsJdsPS5SXy5SvO 5GAcjP2imtbAAIUgUlG5T0QcUO1xoqIFpud2Cw8k9JwK5jArY3qzJKNdRf7CxUXjHNvJPw6zL H/soAZ+nL3pwQotlB0fDAngbSUlKcbgVMj0OXt2ZzKNe8/s60Vsw37LF07FHO/o4MDenyQyzR TJfKG4MQlfVcD6lm6n+9h1sBaAUTkgumkU5VNXc5xckiyrHUmSFojbdHGmpfcBQjGL6upzzbL ZKgY1eHMbkB5QzM3OgwIpmXjrqtYdBppZfV7vmPsSwB20BWzS3XBdWpXKi2+hZyqU8H6RXtBs dAQMgMZuCnH7xhLF4tZCGVoIRTgkWC4b7xprySKJ06D69nHMSGBasSlVh6ARs+HImINLRvcRz X7+SIYm8JyG0fuz1dMPgrC5Xz8NHoo6yCBsqjlJHWApqBs2CNqwfHLaCYv+ipUiAtRKO/EuZm Wpwk9w+EyhiVnqZyrqGiB33OwLkWijXHCp8cpZHptaMR3tbMyCUua3etX6/mcirUHzJ+fktve L2v0gW8yrqaEjsxP2kV4ONwKh/xKARY6mEi6gViR0= X-Spam-Score: 0.0 (/) 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 (-) tag 39135 notabug close 39135 stop On 2020-01-14 09:44, Antti Savolainen wrote: > When doing a shortcut to unmount in a specific order, I am unable to > specify order with angle brackets. For example using 'umount /dev/sda[132]' > will result in the system unmounting them in numerological order. First 1 > then 2 and finally 3. What I need it to do is to first unmount 1, then 3 > and finally 2. It would be nice for the glob to respect the order of > numbers that it was given. Thanks for the report, but you reached the GNU coreutils mailing list while umount is part of util-linux, and the globbing you're referring to is done by your shell. Therefore, you're better off asking at the mailing lists of those packages. As this is not a bug in coreutils, I'm marking it as such, and close this issue in our bug tracker. A little hint: if your shell knows brace expansion "{...}", then you could use that instead of file globbing with "[...]". The following does this with 'echo' put in front of the command in order to see what would be executed: $ echo umount /dev/sda{1,3,2} umount /dev/sda1 /dev/sda3 /dev/sda2 Have a nice day, Berny From unknown Mon Jun 23 02:26:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39135: Globbing with numbers does not allow me to specify order Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 22 Jan 2020 17:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39135 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Antti Savolainen Cc: 39135@debbugs.gnu.org Received: via spool by 39135-submit@debbugs.gnu.org id=B39135.15797139481121 (code B ref 39135); Wed, 22 Jan 2020 17:26:02 +0000 Received: (at 39135) by debbugs.gnu.org; 22 Jan 2020 17:25:48 +0000 Received: from localhost ([127.0.0.1]:51245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuJlE-0000I1-1G for submit@debbugs.gnu.org; Wed, 22 Jan 2020 12:25:48 -0500 Received: from havoc.proulx.com ([96.88.95.61]:40096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iuJlC-0000Hn-0z for 39135@debbugs.gnu.org; Wed, 22 Jan 2020 12:25:46 -0500 Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 0302759C; Wed, 22 Jan 2020 10:25:40 -0700 (MST) Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id BD5632114D; Wed, 22 Jan 2020 10:25:39 -0700 (MST) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 972AD2DC86; Wed, 22 Jan 2020 10:25:39 -0700 (MST) Date: Wed, 22 Jan 2020 10:25:39 -0700 From: Bob Proulx Message-ID: <20200122100026789887740@bob.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Score: 0.0 (/) 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 (-) Antti Savolainen wrote: > When doing a shortcut to unmount in a specific order, I am unable to > specify order with angle brackets. For example using 'umount /dev/sda[132]' > will result in the system unmounting them in numerological order. First 1 > then 2 and finally 3. What I need it to do is to first unmount 1, then 3 > and finally 2. It would be nice for the glob to respect the order of > numbers that it was given. As Bernhard wrote this involves features that have nothing to do with coreutils. However I thought I might say some more too. You say you would like character class expansion of file globbing to preserve the order. But that isn't something that it has ever done before all of the way back 40 years. The [...] brackets give the file glob parser (its called glob because wildcards can match a glob of files) a list of characters to match. These can be ranges such as A-Z or 0-9 and so forth. The collection effectively makes a set of characters. This is expanded by the command line shell. To see the expansion one can use the echo command to echo them out. Try this to see what a command like yours is doing. echo /dev/sda[132] That shows what the umount command line arguments are going to be. The command line shell expands the wildcards and then passes the resulting expansion to the command. The command never sees the wild card itself. Therefore your specific desire is that the command line shell would do something different from what it is doing now. And that would be something different from what it has ever done in the past. This would be a new behavior and a change in historic behavior. And almost certainly one that would break someone who is now depending upon the current behavior of sorting the arguments. They would then file a bug that the arguments were no longer being sorted. And they were there first by decades. Therefore if I were maintaining a shell I would not want to make changes to that ordering since it would certainly break others and generate more bug reports. Instead if you need to have things happen in a specific order then the task is up to you to specify an explicit order. Bernhard suggested brace expansion, which is a GNU bash specific feature. echo /dev/sda{1,3,2} /dev/sda1 /dev/sda3 /dev/sda2 However I am not personally a fan of bash-isms in scripts. They won't work everywhere. Therefore I personally would just explicitly specify the order. umount /dev/sda1 umount /dev/sda3 umount /dev/sda2 Doing things that way is unambiguous. And if that is the correct order then it is the correct order. If you need a command line short cut to make typing this in easier then I personally would create a small shell script. #!/bin/sh # Unmount the devices in mount dependency order. umount /dev/sda1 umount /dev/sda3 umount /dev/sda2 Store this in /usr/local/bin/umount-sda or some such name that makes sense to you and chmod a+x the file to make it executable. Then it is a documentable command to do exactly what is needed. Typical command line completion with TAB will help as a typing aid to expand the file name for you. That is the way I would do it. Bob