This is the mail archive of the
mailing list for the Cygwin project.
Re: Simple find command does not work for * .html
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Matthew Movafaghi <mattmova at hotmail dot com>
- Cc: cygwin at cygwin dot com
- Date: Thu, 8 Sep 2005 21:12:23 -0400 (EDT)
- Subject: Re: Simple find command does not work for * .html
- References: <BAY104-F29381636740A8DA88929E4D6980@phx.gbl>
- Reply-to: cygwin at cygwin dot com
Ugh, top-posting... Reformatted.
On Fri, 9 Sep 2005, Matthew Movafaghi wrote:
> > From: ericblake@XXXXXXX.XXX (Eric Blake)
> > To: Matthew Movafaghi <mattmova@XXXXXXX.XXX>, cygwin@XXXXXX.XXX
> > [snip FULL HEADERS]
Umm, and there was no need to quote the full message headers, either.
> > > For some reason the following find command will not complete for *.html.
> > >
> > > It says: find: paths must precede expression....
> > User error. Remember that the shell does filename globbing before
> > find ever sees its input (unless you have done set -f in a POSIX shell).
> > If the current directory contains .html files, then you really are
> > causing a syntax error.
> > > `find d:\ -type f -perm -u+w -name *.properties`
> > Try 'echo find d:\ -type f -perm -u+w -name *.html' to see what you
> > were really doing, then try
> > 'find d:\ -type f -perm -u+w -name \*.html'
You must've been in a cmd.exe shell if this worked for you. In a POSIX
shell, you'd need to use
find 'd:\' -type f -perm -u+w -name \*.html
(otherwise "d:\ -type" would be interpreted as one argument with the value
> > to fix it. And while you are at it, since this is cygwin, try
> > 'find /cygdrive/d -type f -perm -u+w -name \*.html'
> > to get rid of that pesky backslash (are you in a cmd.com shell,
> > explaining why you didn't quote it properly?) and behave more
> > unixy.
> It was user error... of course. Thanks for the fix.
> I was just trying to find all writiable files of certain types.
> However, the command
> 'find /cygdrive/d -type f -perm -u+w -name \*.html' will sometimes not
> find a writable file when windows thinks that it is. When viewed with
> ls -l, the file doe not look writable, but when viewed with dir *.html
> /A-r /S from a cmd prompt the file shows up.
> Any thoughts?
First off, "dir *.html /A-r" will *not* find all writable files -- it will
find all files with no "read-only" attribute set (not the same thing).
Secondly, access to objects in Windows NT-based systems (NT, 2k, XP) is
controlled by ACLs, or "access control lists". Cygwin tries to map those
into POSIX permissions, but a perfect mapping is not always possible.
For details on how this mapping works, read the "ntsec" section of the
The short answer is, if "ls -l" shows the file as writable, "find -perm
-u+w" will find it, otherwise it won't.
|\ _,,,---,,_ email@example.com
ZZZzz /,`.-'`' -. ;-;;,_ firstname.lastname@example.org
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html