Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Thu, 8 Sep 2005 21:12:23 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Matthew Movafaghi cc: cygwin AT cygwin DOT com Subject: Re: Simple find command does not work for * .html In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Ugh, top-posting... Reformatted. On Fri, 9 Sep 2005, Matthew Movafaghi wrote: > > From: ericblake AT XXXXXXX DOT XXX (Eric Blake) > > To: Matthew Movafaghi , cygwin AT XXXXXX DOT XXX . Thanks. > > [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 "d: type") > > 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 User's Guide. The short answer is, if "ls -l" shows the file as writable, "find -perm -u+w" will find it, otherwise it won't. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,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 Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/