Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2001 17:32:55 -0800
From:      "Crist J . Clark" <cjc@FreeBSD.ORG>
To:        Darren Pilgrim <dmp@pantherdragon.org>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Changing $IFS in a bash shell
Message-ID:  <20011201173255.N13613@blossom.cjclark.org>
In-Reply-To: <3C097584.B51ECEBC@pantherdragon.org>; from dmp@pantherdragon.org on Sat, Dec 01, 2001 at 04:27:48PM -0800
References:  <3C097584.B51ECEBC@pantherdragon.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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=<crtl-v><enter><enter>"). 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011201173255.N13613>