dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: dash@vger.kernel.org
Subject: Re: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
Date: Mon, 20 Oct 2014 22:59:40 +0100	[thread overview]
Message-ID: <20141020215940.GB20449@chaz.gmail.com> (raw)
In-Reply-To: <20141008072636.GA7524@gondor.apana.org.au>

2014-10-08 15:26:36 +0800, Herbert Xu:
> commit 3c06acdac0b1ba0e0acdda513a57ee6e31385dce
> Author: Herbert Xu <herbert@gondor.apana.org.au>
> Date:   Wed Oct 8 15:24:23 2014 +0800
> 
>     [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
>     
>     Currently we do not field-split $@/$* when it isn't quoted and IFS
>     is set but empty.  This is obviously wrong.  This patch fixes this.
[...]

Well, if IFS is empty, field splitting is disabled. There's
nothing in POSIX that clearly says that $@ and $* should expand
to the positional parameters *as separate arguments in list
contexts*. yash and the Bourne shell behave like dash. Only
shells with array support behave differently.

The whole $*/$@ expansion is rather unclear in the POSIX spec.
I've just raised the problem on the Austin group mailing list.

See also

http://thread.gmane.org/gmane.linux.debian.devel.general/197901

Cheers,
Stephane


      reply	other threads:[~2014-10-20 22:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08  7:26 [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty Herbert Xu
2014-10-20 21:59 ` Stephane Chazelas [this message]

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=20141020215940.GB20449@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=dash@vger.kernel.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.
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).