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 Message-ID: <3D63CB90.35B10B81@iee.org> Date: Wed, 21 Aug 2002 18:19:12 +0100 From: Don Sharp X-Accept-Language: en MIME-Version: 1.0 To: My Avatar CC: gnuwin32 Subject: Re: LS -R (Cygwin, latest builds as of 8/15/02, Win2K box) References: <20020821165025 DOT 98344 DOT qmail AT web14508 DOT mail DOT yahoo DOT com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit My Avatar wrote: > > I've read all the FAQs, Groups, MsgBoards, & Cygwin > archives I can find, and although I have found some > user's with similiar problems, none of them ever > seemed to be resolved (as far as I could tell). > > My problem is this. I am trying to use the -R switch > with ls to get a listing of files that I am going > to send to sort (to get a top 10 kind of thing). I > am very fearful that this is going to be flame bait, > but feel I have done all I humanly can right now to > resolve the issue on my own. > > When I enter ls -R *.db, it only returns the matching > files in the current path (and I verified that there > are matching files in the subdirs). > I think you are falling into the trap of thinking that -R will operate on '.' as though it had been included in your argument list. Descent into sub directories will only occur if the *.db expands into at least one argument which is a directory, whereupon its sub directories will be explored. Note that it would list all the contents of such sub directories, it wouldn't prepend the directory name to your *.db. > Here is one thread that almost seems similiar, but > doesnt seem to be resolved... > http://www.cygwin.com/ml/cygwin/1999-08/msg00578.html > ...when I try to do as the author suggests, I get the > following messgage... > $ find . -name *.db > find: paths must precede expression > Usage: find [path...] [expression] > > ...so I tried... > $ find /cygdrive/s/customer/ -name *.db > find: paths must precede expression > Usage: find [path...] [expression] > This is because you should have put single quotes around the *.db like find . -name '*.db' to avoid shell expansion of the *.db > Here is an example of what happens with LS... > $ ls *.db > Copy of Langdef.db RSINFO.db S98pcta.db langFltr.db > qClass.db > > Administrator AT TRAVIS /cygdrive/s/customer/dist10 > $ cd .. > > Administrator AT TRAVIS /cygdrive/s/customer > $ ls -R *.db > ALPHACLS.db ALPHAGRD.db dist.db olddist.db > > Administrator AT TRAVIS /cygdrive/s/customer > $ ls *.db > ALPHACLS.db ALPHAGRD.db dist.db olddist.db > > Your thoughts? > Travis Johnson > HTH Don Sharp -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/