GNU bug report logs - #26228
ls bug

Previous Next

Package: coreutils;

Reported by: Massimo Masotti <massimo.masotti.1960 <at> gmail.com>

Date: Thu, 23 Mar 2017 20:23:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bishop Bettini <bishop.bettini <at> gmail.com>
To: Massimo Masotti <massimo.masotti.1960 <at> gmail.com>
Cc: 26228 <at> debbugs.gnu.org
Subject: bug#26228: ls bug
Date: Thu, 23 Mar 2017 16:36:18 -0400
[Message part 1 (text/plain, inline)]
On Thu, Mar 23, 2017 at 3:57 PM, Massimo Masotti <
massimo.masotti.1960 <at> gmail.com> wrote:

> Hi,
> I have 12 pieces in my disk, from sda1 to sda12.
>
> This is the expected behavior:
>
> [root <at> max ~]# ls -l /dev/sda[1-9]
> brw-rw---- 1 root disk 8, 1 Mar 23 14:39 /dev/sda1
> brw-rw---- 1 root disk 8, 2 Mar 23 14:39 /dev/sda2
> brw-rw---- 1 root disk 8, 3 Mar 23 14:39 /dev/sda3
> brw-rw---- 1 root disk 8, 4 Mar 23 14:39 /dev/sda4
> brw-rw---- 1 root disk 8, 5 Mar 23 14:39 /dev/sda5
> brw-rw---- 1 root disk 8, 6 Mar 23 14:39 /dev/sda6
> brw-rw---- 1 root disk 8, 7 Mar 23 14:39 /dev/sda7
> brw-rw---- 1 root disk 8, 8 Mar 23 14:39 /dev/sda8
> brw-rw---- 1 root disk 8, 9 Mar 23 14:39 /dev/sda9
>
> The following instead seems to me a bug:
>
> [root <at> max ~]# ls -l /dev/sda[1-12]
> brw-rw---- 1 root disk 8, 1 Mar 23 14:39 /dev/sda1
> brw-rw---- 1 root disk 8, 2 Mar 23 14:39 /dev/sda2
>

Don't blame ls, that's your shell globbing: [] denotes a range of single
characters. [a-z], [0-9], etc. If you're using bash, you might want {1..12}
(extended range expansion). See also
http://www.tldp.org/LDP/abs/html/globbingref.html
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 57 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.