SV: LS and spaces in path names (the xth)

Peter J. Acklam pjacklam@online.no
Tue Jun 28 13:38:00 GMT 2005


I don't see the problem.

> ls -hog "CD *"
> ls: CD *: No such file or directory

Of course. There is no file whose name is the four character string "CD *", so ls doesn't find anything.

> ls -hog "CD [12]*"
> ls: CD [12]*: No such file or directory

Ditto. There is no file whose name is the six character string "CD [12]*", so ls doesn't find it.

> ls -hog "CD*[12]*"
> 
> WORKS.

What do you mean by "WORKS"? I get

$ ls -hog "CD*[12]*"
ls: CD*[12]*: No such file or directory

which is exactly as expected since there I have no file with the is no file whose name is the eight character string "CD*[12]*".

If you want to list the CD-files with spaces, try

$ ls -hog CD\ *
-rw-r--r--  1 0 Jun 28 15:30 CD 1 - Multimedia.dat
-rw-r--r--  1 0 Jun 28 15:30 CD 2 - Multimedia.dat

$ ls -hog "CD "*
-rw-r--r--  1 0 Jun 28 15:30 CD 1 - Multimedia.dat
-rw-r--r--  1 0 Jun 28 15:30 CD 2 - Multimedia.dat

Note that the asterisk can not be quoted.

Peter

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list