Subject: SV: LS and spaces in path names (the xth)
From: "Peter J. Acklam" <[email-masked]>
To: <[email-masked]>
Cc: <[email-masked]>
Date: Tue, 28 Jun 2005 15:35:34 +0200 (CEST)

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

--
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/