From owner-freebsd-questions Thu Sep 19 6:20:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D924B37B401 for ; Thu, 19 Sep 2002 06:20:55 -0700 (PDT) Received: from mail2.uits.uconn.edu (mail2.uits.uconn.edu [137.99.25.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3867A43E65 for ; Thu, 19 Sep 2002 06:20:55 -0700 (PDT) (envelope-from matt@forsetti.com) Received: from d80h149.public.uconn.edu (d80h149.public.uconn.edu [137.99.80.149]) by mail2.uits.uconn.edu (8.11.6/8.11.6) with ESMTP id g8JDKih02580; Thu, 19 Sep 2002 09:20:45 -0400 Subject: Re: find case-insensitive challenge From: Matt Smith To: "Brian T. Schellenberger" Cc: Peter Leftwich , FreeBSD LIST In-Reply-To: <200209190757.22640.bts@babbleon.org> References: <20020919013548.H83658-100000@earl-grey.cloud9.net> <200209190757.22640.bts@babbleon.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 19 Sep 2002 09:20:43 -0400 Message-Id: <1032441644.1295.2.camel@localhost> Mime-Version: 1.0 X-MailScanner: Found to be clean Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Or, try "-iname" instead of "-name" man find ... -iname pattern Like -name, but the match is case insensitive. ... Hope that helps, -Matt On Thu, 2002-09-19 at 07:57, Brian T. Schellenberger wrote: > > > > On Thursday 19 September 2002 01:38 am, Peter Leftwich wrote: > | Tonight I surprised myself by running `find ~/Desktop/folder/ -name > | "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` successfully! My first > | custom find command line ever. > | > | But there were two issues -- I had to escape the semicolon with a "\" > > Yes, it always works that way. > > | -- does this ever cause problems for find command lines? > > No, not really. > > | Second, > | this found only *.jpg files and left behind *.JPG files so how do you > | make find be case-insensitive? > > find ~/Desktop/folder/ \( -name "*.jpg" -o -name "*.JPG" \) \ > -exec mv {} ~/Desktop/folderjpgs/ \; > > Actually, what *I* do is avoid having files with capital letters in > them, or spaces, or &'s, or any of those other goofy characters you > sometimes find in Windows file names. Then I don't have to do the > above. I accomplish that with the attached pair of scripts, though > there are no doubts lots of other nice ways to do this. > > (I run the "unmsdos" script over files that I download from the web or > newsgroups or what-have-you. It makes all of file names > "Unix-friendly" and, if the file is a text file, it invokes uncrnl to > change the cr-nl's at the ends of lines into just plan nl's.) > > | -exec ThankYouScript.sh {} \; > > -- > Brian, the man from Babble-On . . . . bts@babbleon.org (personal) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message