Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ksh Emulation Not Clearing Envariables
- X-seq: zsh-users 7447
- From: Chris Jepeway <jepeway@xxxxxxxxxxxxxxxxx>
- To: chet@xxxxxxxxxxx
- Subject: Re: ksh Emulation Not Clearing Envariables
- Date: Tue, 11 May 2004 16:38:09 -0400
- Cc: zsh-users@xxxxxxxxxx, pws@xxxxxxx
- In-reply-to: <040511192759.AA02456.SM@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <19195.1084296895@xxxxxxx> <040511181944.AA29985.SM@xxxxxxxxxxxxxxxxxx> <3BDC51C1-A37B-11D8-B3B9-000A95B34D8E@xxxxxxxxxxxxxxxxx> <040511192759.AA02456.SM@xxxxxxxxxxxxxxxxxx>
Variable assignments specified with special built-in utilities
remain
in effect after the built-in completes; this shall not be the case
with a regular built-in or other utility.
Well...the variable assignment isn't occurring inside the function.
It's outside, put into the environment before the function is called.
Did you actually read the spec?
Nope. I read the excerpts you provided, in the belief that
you meant them to clearly support your statements. Shoot me
for not catching that "[v]ariable assignments specified with
special built-in utilities" meant "variable assignments
preceding the command name."
Maybe reading the `Simple Commands' section will convince you:
If no command name results, variable assignments shall affect the
current execution environment. Otherwise, the variable assignments
shall be exported for the execution environment of the command and
shall not affect the current execution environment (except for special
built-ins).
Yup, sure, that's pretty definitive. What does it mean for
X=one unset X
Nothing, I suppose. unset will unset. Never in a million years
would I have expected after
X=one :
for X to persist, while after
X=one true
X is unset.
I wonder what the original purpose was, here. A "get out of jail
free card" that let code implementing the special built-ins slide?
These things (err, the SBIs) all look commands that *must* be
implemented
as built-ins, so perhaps in some implementation(s) there weren't the
hooks
to unset vars after they completed. POSIX just codified it so
pre-existing
implementations could remain compliant?
Chet Ramey, ITS, CWRU chet@xxxxxxxxxxx
http://tiswww.tis.cwru.edu/~chet/
Me
Chet Ramey, ITS, CWRU chet@xxxxxxxxxxx
http://tiswww.tis.cwru.edu/~chet/
Chris <jepeway@xxxxxxxxxxxxxxxxx>.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author