<<< Date Index >>>     <<< Thread Index >>>

Re: subscribe and zsh array



Gabriel Striewe wrote:[Thu May 06 2004, 07:35:55PM EDT]
> # .zshenv
> mailinglists=(mailinglist1 mailinglist2 ...)
> ...
> 
> How would I use this array in connection with "subscribe"?

Assuming that bash and zsh arrays work similarly, ${mailinglists}
would be the same thing as ${mailinglists[0]}.  I don't think an array
can be exported to the environment, so you'd probably lose
${mailinglists[1..n]} when you run mutt.

However you could transform it to a space-separated list in the shell
prior to running mutt, either in your zsh startup files or in an alias
or function.  For example:

    mutt() {
        mutt_mailinglists="${mailinglists[*]}" /usr/bin/mutt "$@"
    }

or something like that.  Then, of course, you would refer to
$mutt_mailinglists in your .muttrc.

HTH,
Aron