Re: [PATCH] Fix variable assignments in function invocations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux