From owner-freebsd-questions@FreeBSD.ORG Fri Oct 14 20:02:48 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 D122716A41F for ; Fri, 14 Oct 2005 20:02:48 +0000 (GMT) (envelope-from mark.r.cullen@gmail.com) Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6322743D49 for ; Fri, 14 Oct 2005 20:02:48 +0000 (GMT) (envelope-from mark.r.cullen@gmail.com) Received: by qproxy.gmail.com with SMTP id a39so355201qbd for ; Fri, 14 Oct 2005 13:02:47 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=roCMqelSL+VhNrLSUz8jBZMivoDD6mLwX97qwPwKF61QtvWzd1Qax670Y7QV36IXfShpOaR3hKkx90Pwa2r3kLHbhZ4of4AvK0QIdDkpCi1V6Px71EQN/+rt+/FfbE3szd1orgMaYLEETlGQY1louihW8BMeNiWziCP4kYz+DqE= Received: by 10.65.138.4 with SMTP id q4mr19111qbn; Fri, 14 Oct 2005 12:41:41 -0700 (PDT) Received: from ?10.0.0.251? ( [88.96.18.86]) by mx.gmail.com with ESMTP id q13sm3394535qbq.2005.10.14.12.41.41; Fri, 14 Oct 2005 12:41:41 -0700 (PDT) Message-ID: <43500A29.4020008@gmail.com> Date: Fri, 14 Oct 2005 20:42:33 +0100 From: Mark Cullen User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Drew Tomlinson References: <435007F3.8000106@mykitchentable.net> In-Reply-To: <435007F3.8000106@mykitchentable.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions Subject: Re: Help With 'for' Loop 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: Fri, 14 Oct 2005 20:02:48 -0000 Drew Tomlinson wrote: > Sorry to be such a pest today. I'm working on a sh script that uses a > for loop. To test, I've written the following: > > for i in `/usr/bin/find /multimedia/Pictures -iname "*.jpg" -or -iname > "*.gif" -print` > do > echo -e "\n$i" > done > > The first line 'find' returns is "/multimedia/Pictures/1998 > Christmas/April01.JPG" > > Yet 'echo $i' only returns "/multimedia/Pictures/1998", stopping at the > first space. Is it possible to get 'i' to represent the whole string > that 'find' returns? If so, how? > > Thanks, > > Drew > Wild guess.. I would say try something like this... for i in "`/usr/bin/find /home/mrboo -iname \"*.jpg\" -or -iname \"*.gif\" -print" ` do echo -e "\n$i" done