zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Peter Stephenson <p.w.stephenson@ntlworld.com>, zsh-workers@zsh.org
Subject: Re: [PATCH v2] exec: run final pipeline command in a subshell in sh mode
Date: Tue, 9 Jun 2020 12:54:10 +0200	[thread overview]
Message-ID: <CAHYJk3TEdzzC=8i9ede7i6yodSxWFQ7qF1noa+MZML1B3PAokg@mail.gmail.com> (raw)
In-Reply-To: <20200609075728.3c3941d8@tarpaulin.shahaf.local2>

On 6/9/20, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Peter Stephenson wrote on Sun, 07 Jun 2020 18:24 +0100:
>> On Sun, 2020-06-07 at 09:55 -0700, Bart Schaefer wrote:
>> > On Fri, Jun 5, 2020 at 1:42 PM brian m. carlson
>> > <sandals@crustytoothpaste.net> wrote:
>> > >
>> > > I will tell you that as a practical matter, nobody writing code for
>> > > sh
>> > > expects the last command not to be run in a subshell and consequently
>> > > lots of code is practically broken in this case with zsh as /bin/sh.
>> > >
>> >
>> > I believe you, but would be curious to see an example.
>> >
>> > For what it's worth, I'm not opposed to this patch.  I think it's
>> > pretty unlikely that anyone is invoking zsh as sh and still expecting
>> > to be able to (for example) pipe into read to set variables in the
>> > current shell.
>>
>> Yes, since I'm still here, that's my position too.
>>
>> Our general position on consistency is that we'll try our best to
>> keep native mode compatible, while with sh compatibility we'll
>> try to be like other shells and not worry so much about what zsh
>> used to do.
>
> This being the case, I'm happy to defer to consensus.  I won't object
> to an entry in the list of incompatibilities in README, though.
>
> I can't speak for Mikael, of course.

I was only objecting to the commit message in the first place :). I
think the arguments for including it are not very convincing but I
don't really have any at all for not including it.

Surely it must be very rare to run something like
foo | shellfunction
and *depend* on shellfunction not setting any global parameters? Why
would you make shellfunction set global parameters in the first place
if you depend on them not being set? And then only when being piped
to? It seems so strange to me. Anyway, those are just arguments
against the sanity of shellscript writers, not against the inclusion
of the patch.

-- 
Mikael Magnusson

  reply	other threads:[~2020-06-09 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  1:53 [PATCH v2 0/1] Run pipeline command in " brian m. carlson
2020-06-05  1:53 ` [PATCH v2] exec: run final pipeline command in a " brian m. carlson
2020-06-05 10:21   ` Mikael Magnusson
2020-06-05 20:41     ` brian m. carlson
2020-06-06  4:33       ` [PATCH v2] exec: run final pipeline command in a subshell in sh modeZZ Daniel Shahaf
2020-06-06 16:28         ` brian m. carlson
2020-06-07 11:29           ` Daniel Shahaf
2020-06-07 16:55       ` [PATCH v2] exec: run final pipeline command in a subshell in sh mode Bart Schaefer
2020-06-07 17:24         ` Peter Stephenson
2020-06-09  7:57           ` Daniel Shahaf
2020-06-09 10:54             ` Mikael Magnusson [this message]
2020-06-17 18:26               ` Daniel Shahaf
2020-07-03 20:16                 ` brian m. carlson
2020-06-11  0:24         ` brian m. carlson

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='CAHYJk3TEdzzC=8i9ede7i6yodSxWFQ7qF1noa+MZML1B3PAokg@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=p.w.stephenson@ntlworld.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).