Subject: Re: bug#26228: ls bug

From: Bishop Bettini <[email-masked]>
Date: Thu, 23 Mar 2017 16:36:18 -0400

On Thu, Mar 23, 2017 at 3:57 PM, Massimo Masotti <
[email-masked]> wrote:

> Hi,
> I have 12 pieces in my disk, from sda1 to sda12.
>
> This is the expected behavior:
>
> [root@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@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