From owner-freebsd-questions Sat Dec 1 23:17:19 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 F176E37B417 for ; Sat, 1 Dec 2001 23:17:16 -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 16AQsF-0007Q7-00 for freebsd-questions@FreeBSD.ORG; Sun, 02 Dec 2001 07:17:15 +0000 Received: by tanya.raggedclown.net (tanya.raggedclown.net, from userid 500) id E23351111; Sun, 2 Dec 2001 08:17:13 +0100 (CET) Date: Sun, 2 Dec 2001 08:17:13 +0100 From: Cliff Sarginson To: freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell Message-ID: <20011202081713.A17293@raggedclown.net> References: <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <20011201215816.P13613@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011201215816.P13613@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 Sat, Dec 01, 2001 at 09:58:16PM -0800, Crist J . Clark wrote: > On Sat, Dec 01, 2001 at 08:34:57PM -0800, Gary W. Swearingen wrote: > > > > IFS=^M > > > > > > > > What is the proper way to change $IFS? > > > > > > I would expect the last one to work if '^M' is a _literal_ '^M' (that > > > is your keystrokes are, "IFS="). However, I > > > think, > > > > > > IFS="\ > > > " > > > > > > Is probably the "cleanest" way to do it. > > > > 1) I think that sets IFS to nothing since it escapes the newline. > > Sorry, > > $ IFS=" > " > > > 2) The Unix newline character is ^J (line feed), > > not ^M (carriage return). > > Good point. It would be, > > IFS= > > Above, but that doesn't seem to work... > > > 3) In ksh shell, this works: IFS="\n" > > But it doesn't work in bash. IFS=" " Is what I use in real life :) -- Regards Cliff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message