Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: path and += troubles
- X-seq: zsh-users 9712
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: path and += troubles
- Date: Sun, 27 Nov 2005 02:30:42 +0100
- In-reply-to: <E350C29B-12FD-4276-8EA3-D13B4E11AE41@xxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2FDFACEA-C7A6-4F45-897D-B786CC632463@xxxxxxxxxxxxxxx> <200511261032.35289.cht@xxxxxxxxx> <20051126132557.GH13460@xxxxxxxxxxxxx> <E350C29B-12FD-4276-8EA3-D13B4E11AE41@xxxxxxxxxxxxxxx>
On 2005-11-26 07:54:35 -0700, Steven Klass wrote:
> Here's some of the cleanup stuff I read about in this list..
> path=($^path(N))
> setopt EXTENDED_GLOB
> path=(${${path//\/##/\/}%/})
> unsetopt EXTENDED_GLOB
> typeset -U path
This is a bad idea if the user has EXTENDED_GLOB set. Isn't it
possible to turn on EXTENDED_GLOB locally in parameter expansion?
> But can anyone please explain my number 1 item - that is really
> annoying me..
>
> appendPath() {
> # if the path exists delete it..
> deletePath $1 $2
> # Append the path to the end..
> $1+=($2)
> }
>
> 1. Why does += not work when adding to the array - It should right?
$1+=($2) doesn't make sense IMHO. You probably need an eval.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Messages sorted by:
Reverse Date,
Date,
Thread,
Author