Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: Dynamically adding to $mailpath?
- X-seq: zsh-users 5595
- From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
- To: "'Aidan Kehoe'" <kehoea@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: RE: Dynamically adding to $mailpath?
- Date: Thu, 19 Dec 2002 14:42:23 +0300
- Importance: Normal
- In-reply-to: <15873.44013.976882.301072@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
> Should this;
>
> typeset -a mailpath
> for i in ~/mail/*.spool; do
> set $mailpath[$#mailpath+1]="${i}?You have new mail in $(basename $i
> .spool).";
> done
>
> have worked?
No;
1. $mailpath[$#mailpath+1] is evaluated before even trying to execute
anyting so the above is the same as
set ="{i}..."
2. set foo[bar] is wrong for setting any variable anyway
3. you do not need basename in zsh, it does it internally.
I got around it by using $MAILPATH, but
>
> zsh: /home/hcksplat/mail/X.spool?You have new mail in X. not found
> $
>
> doesn't seem right to me. ZSH_VERSION=4.0.4, setopt gives nobeep,
> correct, noglobalrcs, histignoredups, histignorespace, interactive,
> monitor, shinstdin.
>
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.
-andrey
Messages sorted by:
Reverse Date,
Date,
Thread,
Author