From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: 'emulate sh -c' and $0
Date: Tue, 3 Jun 2014 14:10:48 -0700 [thread overview]
Message-ID: <CAH+w=7Y79B25=m2qajTGi-xgZkZLMfvDyz3spnkz=MCXowDKNA@mail.gmail.com> (raw)
In-Reply-To: <20140603212644.455c9981@pws-pc.ntlworld.com>
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
On Jun 3, 2014 1:27 PM, "Peter Stephenson" <p.w.stephenson@ntlworld.com>
wrote:
>
> On Tue, 03 Jun 2014 16:15:25 -0400
> Richard Hansen <rhansen@bbn.com> 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.
next prev parent reply other threads:[~2014-06-03 21:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-29 23:04 Richard Hansen
2014-05-30 3:45 ` Bart Schaefer
2014-05-30 8:49 ` Richard Hansen
2014-05-30 17:00 ` Bart Schaefer
2014-05-30 21:14 ` Richard Hansen
2014-05-31 5:13 ` Bart Schaefer
2014-05-31 23:47 ` Bart Schaefer
2014-06-03 20:15 ` Richard Hansen
2014-06-03 20:26 ` Peter Stephenson
2014-06-03 21:10 ` Bart Schaefer [this message]
2014-06-03 23:35 ` Richard Hansen
2014-06-04 0:09 ` Bart Schaefer
2014-06-03 21:21 ` Bart Schaefer
2014-06-03 22:54 ` Richard Hansen
2014-06-04 0:03 ` Bart Schaefer
2014-06-04 1:10 ` Bart Schaefer
2014-06-04 1:23 ` Bart Schaefer
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='CAH+w=7Y79B25=m2qajTGi-xgZkZLMfvDyz3spnkz=MCXowDKNA@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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).