From owner-freebsd-questions Sat Dec 1 17:33: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id E616237B417 for ; Sat, 1 Dec 2001 17:32:59 -0800 (PST) Received: from dialup-209.245.132.68.dial1.sanjose1.level3.net ([209.245.132.68] helo=blossom.cjclark.org) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ALV4-0006Hf-00; Sat, 01 Dec 2001 17:32:59 -0800 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id fB21Wuo24809; Sat, 1 Dec 2001 17:32:56 -0800 (PST) (envelope-from cjc) Date: Sat, 1 Dec 2001 17:32:55 -0800 From: "Crist J . Clark" To: Darren Pilgrim Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell Message-ID: <20011201173255.N13613@blossom.cjclark.org> References: <3C097584.B51ECEBC@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: <3C097584.B51ECEBC@pantherdragon.org>; from dmp@pantherdragon.org on Sat, Dec 01, 2001 at 04:27:48PM -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 04:27:48PM -0800, Darren Pilgrim wrote: > I need to change &IFS to be just a newline character, so my for-in-do > loop doesn't parse spaces in the item list as delimiters, but I can't > seem to set $IFS properly. None of the following yeild the desired > result: > > IFS=\012 > IFS=\n > 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. -- 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