"ls" finds file1 but "ls file1" does not

Charles D. Russell worwor@bellsouth.net
Tue May 10 04:07:00 GMT 2005


----Original Message----
 >From: Charles D. Russell
 > "ls" finds file1 but "ls file1" does not.  How can this happen?
 >
 > The following example occurred just after I had renamed some *.htm files
 > to *.html using
 > an ash shell script.  No such problem occurred, however, when I used DOS
 > "rename" to make
 > the same change.

  Not 100% sure what's going on here, but can I just ask one thing?

 > $ ls
 > _index.htm*    finder.dat*     lib_over.htm*   setjmp.htm*   time.htm*
 > assert.htm*    float.htm*      lib_prin.htm*   signal.htm*   types.htm*
 > charset.htm*   function.htm*   lib_scan.htm*   stdarg.htm*   wchar.htm*

[etc]  Did your ash script go wrong and rename all those files with actual
asterisks on the end ?

 > Documents/books_open/c/stdcbook_bad/STD_c
 > $ ls assert.htm
 > ls: assert.htm: No such file or directory  <--  **** THIS IS THE PROBLEM
 > ****

  But ISTM there is no such file as assert.htm.  What output do you get from
ls assert.htm\*
   ?
_________________

$ ls assert.htm\*
ls: assert.htm*: No such file or directory

The * in the listing just indicates that the file is executable (an ls 
option that I use by default).  Unaliasing gives:

$ \ls
 _index.htm    finder.dat     lib_over.htm   setjmp.htm   time.htm
 assert.htm    float.htm      lib_prin.htm   signal.htm   types.htm
 charset.htm   function.htm   lib_scan.htm   stdarg.htm   wchar.htm
 crit_pb.htm   gif            limits.htm     stddef.htm   wctype.htm
 ctype.htm     index.htm      locale.htm     stdio.htm   junk
 declare.htm   intro.htm      math.htm       stdlib.htm
 errno.htm     iso646.htm     portable.htm   string.htm
 express.htm   lib_file.htm   preproc.htm    syntax.htm


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