Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
`unset`, zerr(), and `eval`
- X-seq: zsh-workers 5300
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: `unset`, zerr(), and `eval`
- Date: Sat, 6 Feb 1999 15:19:20 -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Consider the two following zsh snippets:
unset IFS
for i in "${(O)${(@f)$(set)}%%\=*}"
do unset $(eval echo $i)
done
unset IFS
for i in "${(O)${(@f)$(set)}%%\=*}"
do eval unset $i
done
The first loop terminates as soon as it hits the first read-only parameter
(which happens to be "status" in this case). The second loop spits out a
warning message for every readonly parameter, and continues until it has
unset every parameter that it can. (Both loops crash if you don't apply
the OLDPWD patch I sent this afternoon.)
Seems there could be two problems here. Isn't it overkill to get zerr()'d
when attempting to unset a readonly parameter? Is it intentional that an
"eval" will mask such errors? (It's kinda perl-ish, I admit, but ...)
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author