Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh 3.0.1 bug



Hi!
here at essi.fr we are a zsh site as we have adopted this shell since its 
creation by P. Falstad...
Now I have a little problem...
Just upgraded to 3.0.1 and the following function that we used for years gets 
suddenly broken.
This is rather annoying because everybody here has this function in its zsh 
environment...

------------------------------------------------------
#!/usr/bin/zsh
#zsh function to delete some dir to PATHS variables
#Author: jlf@xxxxxxx 
#	 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=""
eval TMPARRAY=\$$2
TMPARRAY=`echo ${(s/:/)TMPARRAY}`
setopt shwordsplit
for i in $TMPARRAY
do
	[ "$i" \!= $1 ] && TMPPATH=${TMPPATH}:$i
done
#remove leading colon
TMPPATH=${TMPPATH#:}
#return result
################################################################
${2}=`echo $TMPPATH`
#^^^this line works till zsh3.0.0 and does not work anymore with zsh3.0.1
################################################################
#eval echo \$$2
return 0
--------------------------------------------------------
I know of a workaround for this bug, but I would not like to edit everybody's 
.zshenv (700 persons) :-(
the workaround:
replace 
${2}=`echo $TMPPATH`
by
read $2 <<EOF
$TMPPATH
EOF
If this is a zsh bug, it would be nice to get a fix...

PLEASE ANSWER BY E-MAIL ONLY I'M NOT SUBSCRIBED TO THIS LIST

thanks in advance

-- 
			[jlf]	Tel.  04 92 96 50 50
	Jean-Louis Faraut (jlf@xxxxxxx) Responsable Informatique de l'ESSI
Ecole Superieure en Sciences Informatiques, Sophia-Antipolis (France)





Messages sorted by: Reverse Date, Date, Thread, Author