Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2001 14:49:47 -0800
From:      "Crist J . Clark" <cristjc@earthlink.net>
To:        Darren Pilgrim <dmp@pantherdragon.org>
Cc:        "Gary W. Swearingen" <swear@blarg.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Changing $IFS in a bash shell
Message-ID:  <20011202144947.B27117@blossom.cjclark.org>
In-Reply-To: <3C0AABE1.1DB4F9EC@pantherdragon.org>; from dmp@pantherdragon.org on Sun, Dec 02, 2001 at 02:32:01PM -0800
References:  <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <ausnaup7da.nau@localhost.localdomain> <3C0AABE1.1DB4F9EC@pantherdragon.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Dec 02, 2001 at 02:32:01PM -0800, Darren Pilgrim wrote:
> I solved this one on the command line:
> 
> $ IFS="
> > "
> 
> This gives the result I want insofar as how item list word-splitting
> works now:
> 
> $ ls
> file 1  file 2  file 3  file 4
> $ for dir in `find * -type f` ; do echo -n "test "; echo ${dir}; done
> test file 1
> test file 2
> test file 3
> test file 4
> 
> Now, how do I do the above in a script?  Like this?

Actually, after all of this trying to get a newline in IFS, I think,

  $ IFS=""

Will work fine for what you want too. Either way, there is no reason
not to put,

  IFS="
  "

Or

  IFS=""

Into a script.
-- 
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?20011202144947.B27117>