dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Eric Blake <eblake@redhat.com>, dash <dash@vger.kernel.org>
Subject: Re: [PATCH] Fix variable assignments in function invocations
Date: Fri, 09 Jan 2015 18:55:55 +0100	[thread overview]
Message-ID: <54B0162B.80408@gigawatt.nl> (raw)
In-Reply-To: <54B01242.9000907@redhat.com>

On 09/01/2015 18:39, Eric Blake wrote:
> On 01/09/2015 10:17 AM, Harald van Dijk wrote:
>> A short test script:
>>
>>    f() {
>>      echo inside f, VAR is $VAR
>>      sh -c 'echo inside sh called from f, VAR is $VAR'
>>    }
>>
>>    VAR=value f
>
> This behavior is tricky.  Here's the latest POSIX wording:
> http://austingroupbugs.net/view.php?id=654#c1559

 > [...]

> So the existing dash behavior is compliant, even if different from bash.

Thank you for the reference! I wasn't aware that the wording has since 
changed.

> I have no opinion on whether to take the patch in order to behave more
> like bash, or whether to tell script-writers to fix their script to
> avoid unspecified behavior because dash is already compliant in
> providing a different behavior than bash.

Well, perhaps it was already compliant, perhaps it became compliant by 
changing the standard, but either way, it is compliant now. :)

If either behaviour is allowed, then I believe dash aims to avoid 
breaking changes. Existing scripts written for dash could conceivably 
rely on the current behaviour, so without any real benefit, my patch 
would be a bad idea. bash compatibility is usually not considered a big 
benefit for dash, POSIX compatibility is.

Because of that, I withdraw my patch.

Cheers,
Harald van Dijk

  reply	other threads:[~2015-01-09 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09 17:17 Harald van Dijk
2015-01-09 17:39 ` Eric Blake
2015-01-09 17:55   ` Harald van Dijk [this message]
2015-01-09 19:36   ` Chet Ramey

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=54B0162B.80408@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=eblake@redhat.com \
    --subject='Re: [PATCH] Fix variable assignments in function invocations' \
    /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

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).