zsh-users
 help / color / mirror / code / Atom feed
* Zsh noob: word-splitting headache
@ 2005-01-04 21:03 kynn
  2005-01-04 21:10 ` Clint Adams
  2005-01-04 21:30 ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: kynn @ 2005-01-04 21:03 UTC (permalink / raw)
  To: zsh-users



I'm writing this script in which, among other things, I want to do
something for each line output by some command foo.  The problem is
that the lines output by foo contain whitespace (e.g. "bar baz
frobozz"), so a construct like this

  for i in `foo`
    do something with $i
  done

fails, because i holds individual words instead of whole lines.

I've tried every trick I can think of to prevent the intra-line
word splitting while still allowing the inter-line splitting, but
nothng has worked.  What's the right way to do this?

I looked at the FAQ at http://zsh.sunsite.dk/FAQ for an answer to this
question (as well as the Zsh Manual, the Zsh User Guide, and "From
Bash to Z-Shell", but no luck.

BTW, of all the difficulties I have programming zsh (or any shell for
that matter), a great many of them are in one way or another related
to word splitting.  Is there a *programming* FAQ on zsh word
splitting?

Thanks!

kj


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-07 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-04 21:03 Zsh noob: word-splitting headache kynn
2005-01-04 21:10 ` Clint Adams
2005-01-04 21:35   ` kynn
2005-01-06  2:36   ` Philippe Troin
2005-01-04 21:30 ` Bart Schaefer
2005-01-07 12:03   ` Stephane Chazelas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).