Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZSH's future [longish] ?
- X-seq: zsh-workers 498
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx (zsh-workers)
- Subject: Re: ZSH's future [longish] ?
- Date: Fri, 27 Oct 1995 02:37:52 +0100 (MET)
- In-reply-to: <9510262244.AA21513@xxxxxxxxxxxxxxxxxxxx> from "Mark Borges" at Oct 26, 95 04:44:33 pm
> Z> But it can also be used as a powerful script language. An example:
> Z> with my releases the expansion of ${${(f)$(</etc/group)}%%:*} gives
> Z> the list of the group names from /etc/groups.
>
> Uh-oh. If I use the (f) qualifier I only get the first line -- without
> it, I get all the group names in a single line separated by
> whitespace. A bug in my (old) hzoli version -- 2.6-beta11-test7-hzoli11 --
> perhaps?
No, not a bug. I forgot to mention that it should be put inside double
quotes. Without double quotes word splitting is done on $(</etc/group) which
removes line breaks. Double quotes disable word splitting but the explicit
(f) qualifier forces line splitting which is later handled like an array.
Even rc_expand_param can be used, just try "/${^${(f)$(</etc/group)}%%:*}/".
And this is only a simple example...
Cheers,
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author