From: Nikolai Weibull <zsh-users-list@pcppopper.org>
To: zsh-users@sunsite.dk
Subject: Re: Redirection and Variables
Date: Thu, 21 Oct 2004 16:41:30 +0200 [thread overview]
Message-ID: <20041021144130.GH9224@puritan.pcp.ath.cx> (raw)
In-Reply-To: <25461.1098367054@trentino.logica.co.uk>
* Oliver Kiddle <okiddle@yahoo.co.uk> [Oct 21, 2004 16:00]:
> > Is this the simplest way to do the following?
> >
> > local -A http_programs https_programs mailto_programs ftp_programs
> >
> > http_programs=(xw "/usr/bin/firefox -remote 'openURL(%s, new-tab)'"
> > xt "/usr/bin/elinks '%s'")
> > mailto_programs=(xt "/usr/bin/mutt '%s'")
> You could use one associative array, including more than one piece of
> information in the key. That avoids the need for the (P) flag:
> programs=(
> http_xw "/usr/bin/firefox -remote 'openURL(%s, new-tab)'"
> mailto_xt "/usr/bin/mutt '%s'"
> )
> > echo "${(P)$(echo ${1}_programs\[xw\])}"
> That could then be:
> echo "$programs[$1_xw]"
How very true. It seems that I split the problem along the wrong axis.
It's kind of hard thinking without "hashes-of-hashes",
nikolai
--
::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
prev parent reply other threads:[~2004-10-21 14:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-19 12:02 Nikolai Weibull
2004-10-19 13:04 ` Peter Stephenson
2004-10-19 13:51 ` Nikolai Weibull
2004-10-19 14:01 ` Peter Stephenson
2004-10-19 14:18 ` Nikolai Weibull
2004-10-21 13:57 ` Oliver Kiddle
2004-10-21 14:41 ` Nikolai Weibull [this message]
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=20041021144130.GH9224@puritan.pcp.ath.cx \
--to=zsh-users-list@pcppopper.org \
--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).