Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
(P:string:) glob qualifier-like effect for parameter expansion
- X-seq: zsh-users 19082
- From: Roman Neuhauser <neuhauser@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: (P:string:) glob qualifier-like effect for parameter expansion
- Date: Sun, 14 Sep 2014 22:42:39 +0200
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
hello,
i was looking for a simple way to achieve *(P:--header:),
except my use case is parameter expansion, not globbing.
i've got something like::
fmt="\
From: %an <%ae>
Date: %aD
Subject: %s
"
set -A headers "${(@f):-"$(git show -s --format=$fmt $rev)"}"
and i'd like to add::
mime-construct "${(@???)headers}" ...
to get::
--header "From: ..." --header "Date: ..." --header "Subject: ..."
except it looks i'm "doomed" to a loop::
declare -a headers
for h; do
headers+=(--header $h)
done < <(git show -s --format=$fmt $rev)
mime-construct "${(@)headers}" ...
--
roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author