From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-request@euclid.skiles.gatech.edu Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id KAA05492 for ; Tue, 29 Oct 1996 10:28:53 +1100 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id SAA24202; Mon, 28 Oct 1996 18:30:25 -0500 (EST) Resent-Date: Mon, 28 Oct 1996 18:30:25 -0500 (EST) From: Geoff Wing Message-Id: <199610282325.KAA05469@coral.primenet.com.au> Subject: Re: zsh 3.0.1 bug To: jlf@essi.fr (Faraut Jean-Louis) Date: Tue, 29 Oct 1996 10:25:16 +1100 (EST) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199610281630.RAA05561@essi.essi.fr> from "Faraut Jean-Louis" at Oct 28, 96 05:30:06 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"WJ5Wf.0.4w5.G8KTo"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2290 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Faraut Jean-Louis wrote: :I know of a workaround for this bug, but I would not like to edit everybody's :.zshenv (700 persons) :-( What you'd like is a global function directory which everyone can autoload functions from. And autoload it from /etc/zshenv so people can use it in their .zshenv files. How do they currently access it? Do they all have their own copies of it? :If this is a zsh bug, it would be nice to get a fix... (This was introduced in 3.0.1-test2 (between Sept 3 & 23). I suspect it's to do with Zoltan's changes to lex.c, but then, what do I know :-) We'll let Zoltan clarify this.) Here's a quick cleanup I did. There are a couple of other ways to do it and I suspect there are a couple of unnecessary things in there, but ... #!/usr/bin/zsh #zsh function to delete some dir to PATHS variables #Author: jlf@essi.fr # Ecole Sup'erieure en Sciences Informatiques # Sophia-Antipolis France #Usage: undepend /some/dir PATH_VARIABLE #Example: undepend /usr/openwin/bin PATH # delete any occurrences of /usr/openwin/bin in $PATH # #Check usage if [ $# -ne 2 ] then echo 'Usage: undepend /some/dir PATH_VARIABLE' 2>&1 return 1 fi #scan dirs TMPPATH="" TMPARRAY=$(eval echo '$'${2}) TMPARRAY=( ${(s/:/)=TMPARRAY} ) for i in $TMPARRAY do [ "$i" != $1 ] && TMPPATH=${TMPPATH}:$i done #remove leading colon TMPPATH=${TMPPATH#:} #return result eval ${2}=${TMPPATH} return 0 -- Geoff Wing [gwing@primenet.com.au] PrimeNet - Internet Consultancy Web : http://www.primenet.com.au/ Phone : +61-3-9818 2977 Mobile: 0412 162 441 Facsimile: +61-3-9819 3788