From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11995 invoked from network); 4 Jan 2005 21:05:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jan 2005 21:05:09 -0000 Received: (qmail 79977 invoked from network); 4 Jan 2005 21:05:03 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jan 2005 21:05:03 -0000 Received: (qmail 22936 invoked by alias); 4 Jan 2005 21:03:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8329 Received: (qmail 22896 invoked from network); 4 Jan 2005 21:03:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jan 2005 21:03:24 -0000 Received: (qmail 77068 invoked from network); 4 Jan 2005 21:03:24 -0000 Received: from mail3.panix.com (166.84.1.74) by a.mx.sunsite.dk with SMTP; 4 Jan 2005 21:03:21 -0000 Received: from panix3.panix.com (panix3.panix.com [166.84.1.3]) by mail3.panix.com (Postfix) with ESMTP id A5F1F981DF for ; Tue, 4 Jan 2005 16:03:20 -0500 (EST) Received: (from kynn@localhost) by panix3.panix.com (8.11.6p3/8.8.8/PanixN1.1) id j04L3KU19128; Tue, 4 Jan 2005 16:03:20 -0500 (EST) Date: Tue, 4 Jan 2005 16:03:20 -0500 (EST) Message-Id: <200501042103.j04L3KU19128@panix3.panix.com> From: To: zsh-users@sunsite.dk Subject: Zsh noob: word-splitting headache X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.2 required=6.0 tests=NO_REAL_NAME autolearn=no version=2.63 X-Spam-Hits: 0.2 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