From owner-freebsd-questions@FreeBSD.ORG Wed Aug 5 15:33:44 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC752106566C for ; Wed, 5 Aug 2009 15:33:44 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id 76A9C8FC2A for ; Wed, 5 Aug 2009 15:33:44 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: by fxm24 with SMTP id 24so176724fxm.36 for ; Wed, 05 Aug 2009 08:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=InGNw7eeviqQXRHFSylE/lZmvI2zlaSk2r5va7cLqeU=; b=jO9SDsIAzx7PPhLnI+tOx0iPi0DuLRNf4Eg0ZZ/Z6zLniSdESxN3yTGshUN4HTNhsW ic9ACtRcrgC2efFjjasv9oWw34oRUeJkYOySI+g/QY8RxLvloU1q0QEmK6DLYSh9rPNw bDBG8JDzR6pW6DQ74j8RwofHvzuZMlSBJEY3Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=MM3g/4l8sMNNA6KiS1eIZRM28dXSWZV70CY7xSJOHk6tPj3+Fdnka2Y4VYMJsEcCTR Rf/6nXBmZMUxOSA1MURmyUYNj6/gMOuUEWhazeJtmrHzZzBqiatNZNskcjmSkcSyyGj2 FXm7+gx6Gjn/cGFQnTGV8pZmtMFGixfVeRN/Q= MIME-Version: 1.0 Received: by 10.223.107.135 with SMTP id b7mr103202fap.62.1249486422984; Wed, 05 Aug 2009 08:33:42 -0700 (PDT) In-Reply-To: <200908050712.39131.mel.flynn+fbsd.questions@mailing.thruhere.net> References: <42D44C8E-1E22-426C-A9AA-0FBF2A52188A@socket.net> <4A79367F.8000003@infracaninophile.co.uk> <4ad871310908050800l1158452xb5949f2a1beee47a@mail.gmail.com> <200908050712.39131.mel.flynn+fbsd.questions@mailing.thruhere.net> Date: Wed, 5 Aug 2009 11:33:42 -0400 Message-ID: <4ad871310908050833k54f3f3a7v679737941e3fa235@mail.gmail.com> From: Glen Barber To: Mel Flynn Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: find question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2009 15:33:45 -0000 On Wed, Aug 5, 2009 at 11:12 AM, Mel Flynn wrote: > On Wednesday 05 August 2009 07:00:40 Glen Barber wrote: >> On Wed, Aug 5, 2009 at 3:36 AM, Matthew >> >> Seaman wrote: >> > Try this as: >> > >> > =A0 =A0for line in $( cat $FILELIST ) ; do >> > =A0 =A0 =A0 =A0echo $line >> > =A0 =A0 =A0 =A0find $line -type f >> $TMPFILE >> > =A0 =A0done >> > >> > *assuming that none of the directory names in $FILELIST contain spaces= * >> >> =A0 =A0for line in $( cat $FILELIST | sed -e 's/\ //g') ; do >> =A0 =A0 =A0 =A0echo $line >> =A0 =A0 =A0 =A0find $line -type f >> $TMPFILE >> =A0 =A0done >> >> This *should* fix any directories containing spaces. > > And also make find look in non-existing directories. True, but any script that needs to find directories containing spaces is going to be hack-ish. for line in $( cat $FILELIST | sed -e 's/\ /SPACE/g') ; do echo $line | sed -e 's/SPACE/\ /g' find $line -type f >> $TMPFILE done --=20 Glen Barber