zsh-users
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-users <zsh-users@sunsite.dk>
Subject: Re: path and += troubles
Date: Sun, 27 Nov 2005 02:30:42 +0100	[thread overview]
Message-ID: <20051127013042.GK13460@ay.vinc17.org> (raw)
In-Reply-To: <E350C29B-12FD-4276-8EA3-D13B4E11AE41@pointcircle.com>

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@vinc17.org> - 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


  reply	other threads:[~2005-11-27  1:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-26  4:32 Steven Klass
2005-11-26  9:32 ` Christian Taylor
2005-11-26 13:25   ` Vincent Lefevre
2005-11-26 14:54     ` Steven Klass
2005-11-27  1:30       ` Vincent Lefevre [this message]
2005-11-26 17:00 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051127013042.GK13460@ay.vinc17.org \
    --to=vincent@vinc17.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).