🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1683

Re: Problem with sh/ksh quoting

#1683
From: Paul John Falstad
Date: Wed, 31 Oct 1990 17:21
34 lines
1033 bytes
In article <16289@s.ms.uky.edu> kherron@ms.uky.edu (Kenneth Herron) writes:
>line="this is 'a test'"
>
>for word in $line
>do
>	echo $word
>done
>
>I *want* it to produce:
>this
>is
>a test

Try something like this:

$ IFS='
'
$ line='this
is
a test'
$ for i in $line
> do
> echo $i
> done
this
is
a test
$ ...


--
Paul Falstad, pfalstad@phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD
I would bring back hanging, and go into rope.  I would cut off the more
disreputable parts of the body and use the space for playing fields.
Technical Details
Message-ID: <3726@idunno.Princeton.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!drops.Princeton.EDU!pfalstad
References: <16289@s.ms.uky.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!drops.Princeton.EDU!pfalstad
From: pfalstad@drops.Princeton.EDU (Paul John Falstad)
Newsgroups: comp.unix.shell
Subject: Re: Problem with sh/ksh quoting
Message-ID: <3726@idunno.Princeton.EDU>
Date: 31 Oct 90 17:21:32 GMT
References: <16289@s.ms.uky.edu>
Sender: news@idunno.Princeton.EDU
Distribution: na
Organization: Princeton University, Princeton, New Jersey
Lines: 34