zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Cc: Chris Jepeway <jepeway@blasted-heath.com>
Subject: Re: ksh Emulation Not Clearing Envariables
Date: Tue, 11 May 2004 13:22:19 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0405111306180.13856-100000@toltec.zanshin.com> (raw)
In-Reply-To: <3BDC51C1-A37B-11D8-B3B9-000A95B34D8E@blasted-heath.com>

[Hmm, I haven't seen Chet's original message, yet.]

[It's almost time to move this to zsh-workers.]

On Tue, 11 May 2004, Chris Jepeway wrote:

> > http://www.opengroup.org/onlinepubs/009695399/utilities/ 
> > xcu_chap02.html#tag_02_09_05
> >
> > Where we see
> >
> > 	When a function is executed, it shall have the syntax-error and
> > 	variable-assignment properties described for special built-in
> > 	utilities in the enumerated list at the beginning of Special Built-In
> > 	Utilities.
> >
> > One of those properties is:
> >
> > 	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.

"Variable assignments specified with" refers to this:

> It's outside, put into the environment before the [built-in] is called.

E.g.

	CDPATH=
	CDPATH=/tmp cd foo
	echo $CDPATH

should output "/tmp", because "cd" is a special built-in.  There is no 
other way to interpret "assignments specified with" because an assignment
cannot occur "inside" cd the way it can occur "inside" a function.

> I don't see how the spec can be read to mean "envariables
> poked into a command shall persist across command invocations
> when that command is a shell function."

(1) envariables poked into the environment of a command shall persist
across command invocations when that command is a special-built in.

(2) functions shall have the behavior of special built-ins.

QED.

Again this need not have anything to do with ksh emulation, but it's 
certainly POSIX emulation.

And I think there are other things controlled by the POSIX_BUILTINS 
option (?) so it may not be as easy as turning that off for ksh.


  reply	other threads:[~2004-05-11 20:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-09  0:41 Chris Jepeway
2004-05-09 21:58 ` Bart Schaefer
2004-05-10 14:52   ` Peter Stephenson
2004-05-11 17:03     ` Chris Jepeway
2004-05-11 16:59   ` Chris Jepeway
2004-05-11 17:34     ` Peter Stephenson
     [not found]       ` <040511181944.AA29985.SM@caleb.ins.cwru.edu>
2004-05-11 18:44         ` Chris Jepeway
2004-05-11 20:22           ` Bart Schaefer [this message]
     [not found]           ` <040511192759.AA02456.SM@caleb.ins.cwru.edu>
2004-05-11 20:38             ` Chris Jepeway

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=Pine.LNX.4.44.0405111306180.13856-100000@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=jepeway@blasted-heath.com \
    --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).