From owner-freebsd-questions Sun Dec 2 14:49:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from hawk.prod.itd.earthlink.net (hawk.mail.pas.earthlink.net [207.217.120.22]) by hub.freebsd.org (Postfix) with ESMTP id E0F1C37B419 for ; Sun, 2 Dec 2001 14:49:52 -0800 (PST) Received: from dialup-209.245.138.197.dial1.sanjose1.level3.net ([209.245.138.197] helo=blossom.cjclark.org) by hawk.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16AfQl-0004sO-00; Sun, 02 Dec 2001 14:49:52 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fB2Mnmu30420; Sun, 2 Dec 2001 14:49:48 -0800 (PST) (envelope-from cjc) Date: Sun, 2 Dec 2001 14:49:47 -0800 From: "Crist J . Clark" To: Darren Pilgrim Cc: "Gary W. Swearingen" , freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell Message-ID: <20011202144947.B27117@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <3C0AABE1.1DB4F9EC@pantherdragon.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3C0AABE1.1DB4F9EC@pantherdragon.org>; from dmp@pantherdragon.org on Sun, Dec 02, 2001 at 02:32:01PM -0800 X-URL: http://people.freebsd.org/~cjc/ 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 Sun, Dec 02, 2001 at 02:32:01PM -0800, Darren Pilgrim wrote: > I solved this one on the command line: > > $ IFS=" > > " > > This gives the result I want insofar as how item list word-splitting > works now: > > $ ls > file 1 file 2 file 3 file 4 > $ for dir in `find * -type f` ; do echo -n "test "; echo ${dir}; done > test file 1 > test file 2 > test file 3 > test file 4 > > Now, how do I do the above in a script? Like this? Actually, after all of this trying to get a newline in IFS, I think, $ IFS="" Will work fine for what you want too. Either way, there is no reason not to put, IFS=" " Or IFS="" Into a script. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message