Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamically adding to $mailpath?
- X-seq: zsh-users 5594
- From: Phil Pennock <Phil.Pennock@xxxxxxxxxxx>
- To: Aidan Kehoe <kehoea@xxxxxxxxxxxxx>
- Subject: Re: Dynamically adding to $mailpath?
- Date: Thu, 19 Dec 2002 12:41:52 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <15873.44013.976882.301072@xxxxxxxxxxxxxxxxxx>; from kehoea@xxxxxxxxxxxxx on Thu, Dec 19, 2002 at 11:22:21AM +0000
- Mail-followup-to: Aidan Kehoe <kehoea@xxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <15873.44013.976882.301072@xxxxxxxxxxxxxxxxxx>
On 2002-12-19 at 11:22 +0000, Aidan Kehoe wrote:
> for i in ~/mail/*.spool; do
> set $mailpath[$#mailpath+1]="${i}?You have new mail in $(basename $i .spool).";
> done
>
> have worked? I got around it by using $MAILPATH, but
No, since you set a variable using its name without a $ beforehand. I
have this problem too, when I've been writing too much Perl.
For some reason, the "set" there means that the array part isn't in
arithmetic context, in fact the rest is not evaluated properly, but is
instead treated as one string (or two, with s/=/ /) and put into ARGV.
Since "z" is at the end of the alphabet:
% print -l $@
mailpath[0+1]=/home/phil/Mail/Lists/zsh?You have new mail in zsh.
%
Lose the "set $" and it works for me, after changing to my set-up. And
one optimisation, dropping the subshell ...
typeset -a mailpath
for i in ~/Mail/Lists/*(.); do
mailpath[$#mailpath+1]="${i}?You have new mail in ${i:t}."
done
--
"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