Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamically adding to $mailpath?
- X-seq: zsh-users 5598
- From: Phil Pennock <Phil.Pennock@xxxxxxxxxxx>
- To: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- Subject: Re: Dynamically adding to $mailpath?
- Date: Thu, 19 Dec 2002 13:47:27 +0100
- Cc: 'Aidan Kehoe' <kehoea@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- In-reply-to: <6134254DE87BD411908B00A0C99B044F03A0B5AC@MOWD019A>; from Andrey.Borzenkov@xxxxxxxxxxx on Thu, Dec 19, 2002 at 02:42:23PM +0300
- Mail-followup-to: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>, 'Aidan Kehoe' <kehoea@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15873.44013.976882.301072@xxxxxxxxxxxxxxxxxx> <6134254DE87BD411908B00A0C99B044F03A0B5AC@MOWD019A>
On 2002-12-19 at 14:42 +0300, Borzenkov Andrey wrote:
> mailpath=((${$(echo ~/mail/*.spool(N))//(#m)*/$MATCH?You have new mail in
> ${MATCH:r:t}}))
>
> should work though. Unfortunately you still need one fork (echo) unless I
> miss some obvious way to treat result of nested globbing as array.
What I myself actually do is use a couple of temporary variables.
set -A _foo ~/Mail/Lists/*~*.lock(.) # not D -- don't check .meta etc
set -A _bar ~/Maildir/.*(/)
mailpath=( ${MAIL}
~/Maildir?"New mail in ~/Maildir"
"${^_bar[@]//(#m).*/$MATCH?New mail in $MATCH}"
"${^_foo[@]//(#m)*/$MATCH?You have new mail in ${MATCH:t}}" )
unset _foo _bar
--
"We've got a patent on the conquering of a country through the use of force.
We believe in world peace through extortionate license fees." -- Andy Forster
Messages sorted by:
Reverse Date,
Date,
Thread,
Author