[Buildroot] [PATCH 1/1] fs/cpio/init: preserve arguments
Adrian Perez de Castro
aperez at igalia.com
Wed Feb 21 23:21:34 UTC 2018
On Wed, 21 Feb 2018 23:43:32 +0100, Thomas Petazzoni <thomas.petazzoni at bootlin.com> wrote:
> 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
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 195 bytes
Desc: not available
More information about the buildroot