From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8359 invoked by alias); 3 Jun 2014 21:11:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32685 Received: (qmail 27257 invoked from network); 3 Jun 2014 21:10:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=XnSftBPmqfjWGKfOWUv751hLUjh81XCdBzB/GP4FP3k=; b=hXu1AWkDI586VWwNEeNnJMHSkBxRir1XnwQ4K1rqSJNt3hXnAd51/9RTYOU51RjGeS DSIk80p/6Z8DYUQenINEiS1mwSNG+GaioAwitC3al9wA2uwso/cGM7uW2Fv7+GLaM1CV nQ9dgkyqRy/t13DE/DYgt36HfcFZ3f7ofXXOSB8DSpGeJniz9BQdxQVPpOF3J/hR5mZ8 Ov0tJh57hTj2KxJNC8bJuqYy6S8FL22Ri3r+nmqpoG+KGI7lW5546kq9C+HeaWNQzDRL G88ZQStuG1ipzuapGrCC9JHx3JGUsFF/cos3pdOgYWoHC5HHYO1A1k/acF4FDc2JtYe5 1BEw== X-Gm-Message-State: ALoCoQkFXKG2uYgbdunlo67fTk1k9GL+/7IuuEnqjB/YwBZPpd4w+JB1HDi327Y2x42j57QIBYPn MIME-Version: 1.0 X-Received: by 10.224.38.204 with SMTP id c12mr65994166qae.1.1401829848769; Tue, 03 Jun 2014 14:10:48 -0700 (PDT) In-Reply-To: <20140603212644.455c9981@pws-pc.ntlworld.com> References: <5387BD0D.8090202@bbn.com> <140529204533.ZM5362@torch.brasslantern.com> <5388461D.8060203@bbn.com> <140530100050.ZM18382@torch.brasslantern.com> <5388F4C3.6070801@bbn.com> <140530221301.ZM31798@torch.brasslantern.com> <538E2CDD.7070106@bbn.com> <20140603212644.455c9981@pws-pc.ntlworld.com> Date: Tue, 3 Jun 2014 14:10:48 -0700 Message-ID: Subject: Re: 'emulate sh -c' and $0 From: Bart Schaefer To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary=001a1134a5e02c7c5104faf4f273 --001a1134a5e02c7c5104faf4f273 Content-Type: text/plain; charset=UTF-8 On Jun 3, 2014 1:27 PM, "Peter Stephenson" wrote: > > On Tue, 03 Jun 2014 16:15:25 -0400 > Richard Hansen wrote: > > Although it would be a behavior change, I think it would be best if both > > 'emulate sh' and 'emulate sh -c' set POSIX_ARGZERO by default > > Yes, that's the policy --- backward compatibility is for native mode, sh > compatibility can be improved without worrying about that. The complexity here is that we're not just dealing with a particular emulation, we're dealing with switching from one emulation to another (and possibly back again) in the middle of a running shell session, and the effect that has on a dynamically scoped variable that crosses the emulation boundaries. If I start in zsh mode and change $0, or $PATH, or any other parameter, and then enter a different emulation, the values of those parameters don't normally change. > I'm not sure why we missed this one. Most of the POSIX options are on > in sh emulations. We didn't really miss it -- FUNCTION_ARGZERO is correctly turned off when in sh emulation. The complication is that it affects $0 only upon entry to the scope, so although $0 doesn't change *again*, it also doesn't revert if it was changed previously. --001a1134a5e02c7c5104faf4f273--