Is this a bug?

View: New views
3 Messages — Rating Filter:   Alert me  

Is this a bug?

by ????? ??????/Nachshon Yeshurun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello sir

Running the following command on Ubuntu 9.10 produced the following result:
nachshon@nachshon-ubuntu-vm:~$ ls *[0-9]
Abcd4  m97  parfile1  Parfile2

dir1:
file1  file3  pfile2  Pfile4  pxtmp  usera1
nachshon@nachshon-ubuntu-vm:~$

I think the file pxtmp located in dir1 should not have appeared in the answer since it does not end with a numeric character.

Is this a bug?

Thanks
Nachshon Yeshurun
e-mail : nachshony@...



Re: Is this a bug?

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to ????? ??????/Nachshon Yeshurun on 11/5/2009 6:46 AM:

> Hello sir
>
> Running the following command on Ubuntu 9.10 produced the following result:
> nachshon@nachshon-ubuntu-vm:~$ ls *[0-9]
> Abcd4  m97  parfile1  Parfile2
>
> dir1:
> file1  file3  pfile2  Pfile4  pxtmp  usera1
> nachshon@nachshon-ubuntu-vm:~$
>
> I think the file pxtmp located in dir1 should not have appeared in the answer since it does not end with a numeric character.

Not a bug.  dir1 ends in a 1, so you got the results of 'ls dir1', which
lists the contents of that directory without regards to whether the
contents match the original glob you typed on the command line.  Globbing
is done before ls starts; to see what you really did, try:

$ ls *[0-9]

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkry4fIACgkQ84KuGfSFAYD77gCg1R45uJJiTWBmYEZMUTRC/4uI
AokAoMoMyBDyDEqDjabiUhuVMnPCRS7X
=o0pV
-----END PGP SIGNATURE-----



Re: Is this a bug?

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eric Blake <ebb9 <at> byu.net> writes:

> Not a bug.  dir1 ends in a 1, so you got the results of 'ls dir1', which
> lists the contents of that directory without regards to whether the
> contents match the original glob you typed on the command line.  Globbing
> is done before ls starts; to see what you really did, try:
>
> $ ls *[0-9]

I typo'd that.  I meant for you to try:

$ echo ls *[0-9]

--
Eric Blake