From owner-freebsd-questions Wed Sep 18 23:12:42 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 6415037B401 for ; Wed, 18 Sep 2002 23:12:41 -0700 (PDT) Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 631F643E4A for ; Wed, 18 Sep 2002 23:12:40 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-a149.otenet.gr [212.205.215.149]) by mailsrv.otenet.gr (8.12.4/8.12.4) with ESMTP id g8J6CbU8007000; Thu, 19 Sep 2002 09:12:38 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g8J6CZBZ060459; Thu, 19 Sep 2002 09:12:36 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g8J6CUHt060430; Thu, 19 Sep 2002 09:12:30 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 19 Sep 2002 09:12:26 +0300 From: Giorgos Keramidas To: Peter Leftwich Cc: FreeBSD LIST Subject: Re: find case-insensitive challenge Message-ID: <20020919061225.GE39149@hades.hell.gr> References: <20020919013548.H83658-100000@earl-grey.cloud9.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020919013548.H83658-100000@earl-grey.cloud9.net> X-PGP-Fingerprint: C1EB 0653 DB8B A557 3829 00F9 D60F 941A 3186 03B6 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 On 2002-09-19 01:38, Peter Leftwich wrote: > Tonight I surprised myself by running > `find ~/Desktop/folder/ -name "*.jpg" -exec mv {} ~/Desktop/folderjpgs/ \;` > But there were two issues -- I had to escape the semicolon with a "\" -- > does this ever cause problems for find command lines? The `\' character makes sure that your shell doesn't intepret ';' in the usual sense (as a command separator). > Second, this found only *.jpg files and left behind *.JPG files so > how do you make find be case-insensitive? -exec ThankYouScript.sh {} \; Two ways. a) Use -iname instead of -name. b) Use filename globbing, as in: find folder/ -name '*.[mM][pP]3' The character classes [mm] and [pP] make sure that both variations of each character are considered valid matches. This is my preferred way of matching files when I only want to ignore the case of one or two characters. -- Giorgos Keramidas FreeBSD 4.6-RELEASE #0: Wed Sep 18 23:08:01 EEST 2002 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message