DASH Shell discussions
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Gioele Barabucci <gioele@svario.it>
Cc: dash@vger.kernel.org
Subject: Re: [BUG] dash uses $* instead of $@ in variable assignments
Date: Thu, 26 Nov 2015 22:07:46 +0100	[thread overview]
Message-ID: <565774A2.8070800@gigawatt.nl> (raw)
In-Reply-To: <n37neq$eem$1@ger.gmane.org>

On 26/11/2015 20:44, Gioele Barabucci wrote:
> Hello,
>
> I am forwarding a bug [1] reported by a Debian user: dash incorrectly
> uses `$*` instead of the requested `$@` inside variable assignments.
> The current version of dash is affected by this bug.
>
> A simple test from the original reporter:
>
>      $ dash -c 'IFS=:$IFS ; set -- a b c ; echo "$@" ; x="$@" ; echo "$x"'
>      a b c
>      a:b:c
>
>      $ bash --posix -c 'IFS=:$IFS ; set -- a b c ; echo "$@" ; x="$@" ;
> echo "$x"'
>      a b c
>      a b c

The behaviour for "$@" is underspecified except for very specific 
situations. Both behaviours are very defensible. There is an attempt to 
clear up the requirements for the future, but even with the cleared up 
wording, the behaviour of var=$@ and var="$@" would remain unspecified. 
See <http://austingroupbugs.net/view.php?id=888> for details.

Cheers,
Harald van Dijk

> This error is reproducible with dash 0.5.7 and with the current master
> git master branch, commit 2e5842258bd5b252ffdaa630db09c9a19a9717ca.
>
> [1] https://bugs.debian.org/764365
>
> --
> Gioele Barabucci <gioele@svario.it>
>
> --
> To unsubscribe from this list: send the line "unsubscribe dash" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2015-11-26 21:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 19:44 [BUG] dash uses $* instead of $@ in variable assignments Gioele Barabucci
2015-11-26 21:07 ` Harald van Dijk [this message]
2015-11-26 21:37 ` Stephane Chazelas
2015-12-02 22:10   ` Gioele Barabucci

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=565774A2.8070800@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=gioele@svario.it \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox