From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28305 invoked from network); 11 May 2004 20:23:51 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 11 May 2004 20:23:51 -0000 Received: (qmail 8361 invoked from network); 11 May 2004 20:23:02 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 May 2004 20:23:02 -0000 Received: (qmail 14571 invoked by alias); 11 May 2004 20:22:52 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7446 Received: (qmail 14561 invoked from network); 11 May 2004 20:22:52 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 11 May 2004 20:22:49 -0000 Received: (qmail 7530 invoked from network); 11 May 2004 20:22:48 -0000 Received: from unknown (HELO moonbase.zanshin.com) (root@167.160.213.139) by a.mx.sunsite.dk with SMTP; 11 May 2004 20:22:45 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i4BKMQhN002502; Tue, 11 May 2004 13:22:26 -0700 Date: Tue, 11 May 2004 13:22:19 -0700 (PDT) From: Bart Schaefer Sender: schaefer@toltec.zanshin.com Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk cc: Chris Jepeway Subject: Re: ksh Emulation Not Clearing Envariables In-Reply-To: <3BDC51C1-A37B-11D8-B3B9-000A95B34D8E@blasted-heath.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 [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.