From owner-freebsd-questions@FreeBSD.ORG Wed Aug 1 14:58:44 2007 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 9EDFD16A417 for ; Wed, 1 Aug 2007 14:58:44 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.freebsd.org (Postfix) with ESMTP id A3FDC13C467 for ; Wed, 1 Aug 2007 14:58:43 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: by py-out-1112.google.com with SMTP id a73so443897pye for ; Wed, 01 Aug 2007 07:58:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=lDOBgvfJ6/GY0YN8E7Err6ZMG+oSODQJgMCCjbMbHHnXlM7erZacrBBGJUumGZpoJ3MlArB0A+D5KYTP6bd0Bps4xSO6WHlmFnCaKDmPSXSYkptHZbLfQLjwHQ99pnP92f1krwKA/ZouX0+AtZGgJiPZSpWStz1pgqg072bZirc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=DlAVae7lHyQ64/YieR7sX+7ogjR/pr1kNxSwo9rcLKDe/EwOERL2TnsP52RPjBqv0pVOXH7WLgpS8Aq/N/+g71ekS/m4sBUfTcDyVBKCiPwAUnAKGN6kvRG6cAz96Z5J7GfeGJ5rya+dQbmXUq/51VUpnv/eSVey7u0Z8n4cr+s= Received: by 10.35.92.18 with SMTP id u18mr1049614pyl.1185980322562; Wed, 01 Aug 2007 07:58:42 -0700 (PDT) Received: from ?10.0.0.14? ( [74.95.66.25]) by mx.google.com with ESMTPS id f77sm1282970pyh.2007.08.01.07.58.41 (version=SSLv3 cipher=OTHER); Wed, 01 Aug 2007 07:58:42 -0700 (PDT) In-Reply-To: <200708011654.08611.wundram@beenic.net> References: <18096.39488.530454.883753@jerusalem.litteratus.org> <200708011654.08611.wundram@beenic.net> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <41DEA020-0134-46DB-A6E1-B8D0881768FE@gmail.com> Content-Transfer-Encoding: 7bit From: Eric Crist Date: Wed, 1 Aug 2007 09:58:38 -0500 To: "Heiko Wundram (Beenic)" X-Mailer: Apple Mail (2.752.3) Cc: freebsd-questions@freebsd.org Subject: Re: semi OT: sh scripting problem 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, 01 Aug 2007 14:58:44 -0000 On Aug 1, 2007, at 9:54 AMAug 1, 2007, Heiko Wundram (Beenic) wrote: > Am Mittwoch 01 August 2007 16:35:44 schrieb Robert Huff: >> Is there a way within the script - or, failing that, by >> modifying FILE - to not break at the whitespace? > > If you're using bash, set IFS to the newline only before looping. I > guess the > tcsh also has a similar setting, but I wouldn't know where to look. > > --- > IFS=" > " > > for i in `cat file` > do > ... > done > This also works for sh. To the OP, simply add the lines above your for listed above to your script, and it should work. No bash required. Eric Crist