Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-Id: <5.1.0.14.2.20020706131630.01d1eaf8@pop3.cris.com>
X-Sender: rrschulz@pop3.cris.com
Date: Sat, 06 Jul 2002 13:19:23 -0700
To: "Jim George" <jim.george@blueyonder.co.uk>,
   "Hari Turlapati" <hturlapati@yahoo.co.in>, <cygwin@cygwin.com>
From: Randall R Schulz <rrschulz@cris.com>
Subject: Re: ls -R doesn't work; V1.3.12 on Win2000
In-Reply-To: <5.1.0.14.2.20020706130513.025cca18@pop3.cris.com>
References: <009401c224c3$087da5b0$0400a8c0@JIMGEORGE>
 <000901c22458$419aef30$9e00100a@HTURLAPATI>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format=flowed

Jim, Hari,

Sorry... I didn't review my posting critically before sending it off...

There's an oversight in both my and Jim's posting: The "." character is the 
single-character match-any pattern character in all the grep variants (and 
in other programs, such as sed and Perl), and hence must be escaped to be 
interpreted literally as the period character.

So the proper incantation of my example is:

         ls -laR |egrep -i '\.(doc|pdf|rtf)'

Randall


At 13:10 2002-07-06, Randall R Schulz wrote:
>Jim,
>
>Apart from the fact that, as Chris F. pointed out, you and Hari seem to 
>share a misconception about how the "-R" option to "ls" works, your 
>suggestion about using grep is probably better, in this instance, than 
>involving "find" as I said you "must" do (a very poor and inaccurate 
>choice of words).
>
>You'll probably want to use the "-i" option to grep so that it matches the 
>letters in the suffixes case insensitively, since Windows doesn't care 
>about alphabetic case in any part of a file name.
>
>If you use "egrep" you can get multiple suffixes selected in a single command:
>
>         ls -laR |egrep -i '.(doc|pdf|rtf)'
>
>for example.
>
>
>Randall Schulz


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

