From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
linux-gpio@vger.kernel.org
Subject: Re: [PATCH libgpiod 2/4] tools: tests: use $@ instead of $*
Date: Mon, 27 May 2024 18:24:35 +0800 [thread overview]
Message-ID: <20240527102435.GA61454@rigel> (raw)
In-Reply-To: <CAMRc=Mfk_r7v86wfgQgeSGxwVFZkm9SUXw5tFJxBX6cVFAHPUw@mail.gmail.com>
On Mon, May 27, 2024 at 11:49:09AM +0200, Bartosz Golaszewski wrote:
> On Sat, May 25, 2024 at 3:54 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > On Fri, May 24, 2024 at 08:03:28PM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > $@ does not break up quoted arguments which is what we want in all cases
> > > in the bash test-suite. Use it instead of $*.
> > >
> >
> > I believe it needs to be "$@". Everywhere.
> >
> > Where do we use quoted arguments/whitespaced parameters?
> > So this is purely about "good" shell? In that case why stop here - e.g.
> > shellcheck picks up a load more "Double quote to prevent splitting/globbing"
> > and the like.
> >
>
> You're not wrong but I have an impression that this is just a
> sarcastic way of telling me this change is not needed. Could you
> confirm?
>
Me? Sarcastic? ;-) Well, yes and no, but mainly no.
Strictly speaking, the change is not needed, given the functions in question
are only used internally and we know whitespace is not an issue.
OTOH, I'm fine with this change, but I do think in that case we should fix
everything, to some accepted standard of "good" shell.
I believe Andy suggested the same. I happened to suggest shellcheck as the
standard as that is what my editor happened to be using.
Happy to go with something else if you have a better alternative.
If you want to apply this series (after fixing the "$@"), I'm happy to patch
that to correct all the other things that shellcheck throws up - there are
lots.
Then if we do happen to make use of whitespace in the future we're good.
Cheers,
Kent.
next prev parent reply other threads:[~2024-05-27 10:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 18:03 [PATCH libgpiod 0/4] tools: tests: fix a few issues in bash scripts Bartosz Golaszewski
2024-05-24 18:03 ` [PATCH libgpiod 1/4] tools: tests: use tabs for indentation consistently Bartosz Golaszewski
2024-05-24 18:03 ` [PATCH libgpiod 2/4] tools: tests: use $@ instead of $* Bartosz Golaszewski
2024-05-25 1:54 ` Kent Gibson
2024-05-27 9:49 ` Bartosz Golaszewski
2024-05-27 10:24 ` Kent Gibson [this message]
2024-05-27 11:37 ` Bartosz Golaszewski
2024-05-24 18:03 ` [PATCH libgpiod 3/4] tools: tests: remove unneeded ';' in while loops Bartosz Golaszewski
2024-05-24 18:03 ` [PATCH libgpiod 4/4] tools: tests: remove dependency on grep Bartosz Golaszewski
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=20240527102435.GA61454@rigel \
--to=warthog618@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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).