From owner-freebsd-questions@FreeBSD.ORG Wed Aug 1 14:35:50 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E1716A41F for ; Wed, 1 Aug 2007 14:35:50 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 574F213C48A for ; Wed, 1 Aug 2007 14:35:50 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from mr08.lnh.mail.rcn.net ([207.172.157.28]) by smtp02.lnh.mail.rcn.net with ESMTP; 01 Aug 2007 10:35:49 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr08.lnh.mail.rcn.net (MOS 3.8.3-GA) with ESMTP id IYP60798; Wed, 1 Aug 2007 10:35:49 -0400 (EDT) Received: from 65-78-26-179.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([65.78.26.179]) by smtp01.lnh.mail.rcn.net with ESMTP; 01 Aug 2007 10:35:44 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18096.39488.530454.883753@jerusalem.litteratus.org> Date: Wed, 1 Aug 2007 10:35:44 -0400 To: questions@freebsd.org X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr08.lnh.mail.rcn.net) Cc: Subject: 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:35:50 -0000 (This is probably a FAQ, and I'll take a pointer (or even the magic words to identify the problem) instead of an answer.) Let's suppose I have a file FILE, with contents: foo bar grill baz If I do "cat FILE", everything comes out fine. If, however, I write a script: #!/bin/sh for i in `cat FILE` do . . . . done $i is set to foo bar grill baz Is there a way within the script - or, failing that, by modifying FILE - to not break at the whitespace? Robert Huff