Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Perez de Castro <aperez@igalia.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] fs/cpio/init: preserve arguments
Date: Wed, 21 Feb 2018 23:21:34 +0000	[thread overview]
Message-ID: <20180221232134.GD22894@momiji> (raw)
In-Reply-To: <20180221234332.0aab34e2@windsurf.lan>

On Wed, 21 Feb 2018 23:43:32 +0100, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
> 
> On Wed, 21 Feb 2018 16:02:16 -0500, Ga?l PORTAY wrote:
> > Use "$@" instead of $* to preserve argument.
> 
> Thanks for your patch, but why ? The commit log needs to explain the
> use-case/motivations/reasons.

Using $* here will split each of the arguments at the spaces (well, at any of
the characters fro $IFS): that means that passing 'has space' as argument,
using $* will result in two arguments 'has' and 'space' being passed down.
Using "$@" prevents $IFS-splitting and passes argument unchanged as-is.

In most cases whenever there is a $* in a shell script, pretty much it means
that passing the parameters with spaces (file names, paths, etc.) will break
things.

Cheers,


--
 Adri?n ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180221/3604ce5f/attachment.asc>

  reply	other threads:[~2018-02-21 23:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 21:02 [Buildroot] [PATCH 1/1] fs/cpio/init: preserve arguments Gaël PORTAY
2018-02-21 22:43 ` Thomas Petazzoni
2018-02-21 23:21   ` Adrian Perez de Castro [this message]
2018-02-22 14:38   ` Gaël PORTAY
2018-02-21 23:17 ` Adrian Perez de Castro
2018-02-26 19:51 ` Peter Korsgaard

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=20180221232134.GD22894@momiji \
    --to=aperez@igalia.com \
    --cc=buildroot@busybox.net \
    /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