From owner-freebsd-questions Sat Dec 1 21:59:19 2001 Delivered-To: freebsd-questions@freebsd.org Received: from snipe.prod.itd.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id BBAB037B417 for ; Sat, 1 Dec 2001 21:59:15 -0800 (PST) Received: from dialup-209.245.132.68.dial1.sanjose1.level3.net ([209.245.132.68] helo=blossom.cjclark.org) by snipe.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16APef-0005j1-00; Sat, 01 Dec 2001 21:59:14 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fB25wOH25378; Sat, 1 Dec 2001 21:58:24 -0800 (PST) (envelope-from cjc) Date: Sat, 1 Dec 2001 21:58:16 -0800 From: "Crist J . Clark" To: "Gary W. Swearingen" Cc: Darren Pilgrim , freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell Message-ID: <20011201215816.P13613@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from swear@blarg.net on Sat, Dec 01, 2001 at 08:34:57PM -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 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. -- 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