From: Salvatore Bonaccorso <carnil@debian.org>
To: NeilBrown <neilb@suse.de>, Steve Dickson <steved@redhat.com>
Cc: linux-nfs@vger.kernel.org, Ben Hutchings <benh@debian.org>,
Salvatore Bonaccorso <carnil@debian.org>
Subject: [PATCH nfs-utils] start-statd: Fix shellcheck warnings
Date: Sun, 9 Jul 2023 09:20:29 +0200 [thread overview]
Message-ID: <20230709072028.829990-1-carnil@debian.org> (raw)
From: Ben Hutchings <benh@debian.org>
shellcheck currently complains:
In utils/statd/start-statd line 14:
[ 1`cat /run/rpc.statd.pid` -gt 1 ] &&
^----------------------^ SC2046 (warning): Quote this to prevent word splitting.
^----------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
[ 1$(cat /run/rpc.statd.pid) -gt 1 ] &&
In utils/statd/start-statd line 15:
kill -0 `cat /run/rpc.statd.pid` > /dev/null 2>&1
^----------------------^ SC2046 (warning): Quote this to prevent word splitting.
^----------------------^ SC2006 (style): Use $(...) notation instead of legacy backticks `...`.
Did you mean:
kill -0 $(cat /run/rpc.statd.pid) > /dev/null 2>&1
Use quotes and $() as recommended.
Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
---
utils/statd/start-statd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index 2baf73c385cf..b11a7d91a7f6 100755
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -11,8 +11,8 @@ exec 9> /run/rpc.statd.lock
flock -e 9
if [ -s /run/rpc.statd.pid ] &&
- [ 1`cat /run/rpc.statd.pid` -gt 1 ] &&
- kill -0 `cat /run/rpc.statd.pid` > /dev/null 2>&1
+ [ "1$(cat /run/rpc.statd.pid)" -gt 1 ] &&
+ kill -0 "$(cat /run/rpc.statd.pid)" > /dev/null 2>&1
then
# statd already running - must have been slow to respond.
exit 0
--
2.40.1
next reply other threads:[~2023-07-09 7:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-09 7:20 Salvatore Bonaccorso [this message]
2023-07-17 21:49 ` [PATCH nfs-utils] start-statd: Fix shellcheck warnings Steve Dickson
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=20230709072028.829990-1-carnil@debian.org \
--to=carnil@debian.org \
--cc=benh@debian.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=steved@redhat.com \
/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