Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2001 08:17:13 +0100
From:      Cliff Sarginson <cliff@raggedclown.net>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Changing $IFS in a bash shell
Message-ID:  <20011202081713.A17293@raggedclown.net>
In-Reply-To: <20011201215816.P13613@blossom.cjclark.org>
References:  <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <ausnaup7da.nau@localhost.localdomain> <20011201215816.P13613@blossom.cjclark.org>

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




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