Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Zsh noob: word-splitting headache
- X-seq: zsh-users 8329
- From: <kynn@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Zsh noob: word-splitting headache
- Date: Tue, 4 Jan 2005 16:03:20 -0500 (EST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author