From: Philippe Troin <phil@fifi.org>
To: Clint Adams <clint@zsh.org>
Cc: kynn@panix.com, zsh-users@sunsite.dk
Subject: Re: Zsh noob: word-splitting headache
Date: 05 Jan 2005 18:36:35 -0800 [thread overview]
Message-ID: <87652bgu6k.fsf@ceramic.fifi.org> (raw)
In-Reply-To: <20050104211025.GA27698@scowler.net>
Clint Adams <clint@zsh.org> writes:
> > for i in `foo`
> > do something with $i
> > done
>
> for i in ${(f)"$(foo)"}
> do something with $i
> done
I tend to prefer making foo print NUL-separated records and use:
for i in ${(ps:\0:)"$(foo)"}
do something with $i
done
works with such foos as "find . -print0"
Now, I can handle ANY filename, including the ones containing
newlines.
Phil.
next prev parent reply other threads:[~2005-01-06 2:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-04 21:03 kynn
2005-01-04 21:10 ` Clint Adams
2005-01-04 21:35 ` kynn
2005-01-06 2:36 ` Philippe Troin [this message]
2005-01-04 21:30 ` Bart Schaefer
2005-01-07 12:03 ` Stephane Chazelas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87652bgu6k.fsf@ceramic.fifi.org \
--to=phil@fifi.org \
--cc=clint@zsh.org \
--cc=kynn@panix.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).