From owner-freebsd-questions Sun Dec 2 15:49:33 2001 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20]) by hub.freebsd.org (Postfix) with ESMTP id 5AB5937B416 for ; Sun, 2 Dec 2001 15:49:31 -0800 (PST) Received: from [212.238.194.207] (helo=tanya.raggedclown.net) by post.mail.nl.demon.net with esmtp (Exim 3.33 #1) id 16AgMU-0002Ok-00 for freebsd-questions@FreeBSD.ORG; Sun, 02 Dec 2001 23:49:30 +0000 Received: by tanya.raggedclown.net (tanya.raggedclown.net, from userid 500) id CF3A21113; Mon, 3 Dec 2001 00:49:28 +0100 (CET) Date: Mon, 3 Dec 2001 00:49:28 +0100 From: Cliff Sarginson To: freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell Message-ID: <20011203004928.D2208@raggedclown.net> References: <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <3C0AABE1.1DB4F9EC@pantherdragon.org> <20011202144947.B27117@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011202144947.B27117@blossom.cjclark.org> User-Agent: Mutt/1.3.22.1i 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:49:47PM -0800, Crist J . Clark wrote: > 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=" > " > This works in bash, honestly, I have written scripts in production use as we speak that rely on it ! > Or > > IFS="" > This doesn't work. Well, let me qualify that. It never worked in any bash script I have been paid to write ! -- Regards Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message