start-statd: Fix shellcheck warnings
Subsystems (2)
PATCH 1/1 start-statd: Fix shellcheck warnings
From: Ben Hutchings <[email protected]>
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 <[email protected]>
Signed-off-by Salvatore Bonaccorso <[email protected]>
--- utils/statd/start-statd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
utils/statd/start-statd +2 -2
@@ -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
Signature · 1 line
2.40.1
Quoted 17 lines · Salvatore Bonaccorso
From: Ben Hutchings <[email protected]>
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 `...`.
Quoted 7 lines
Did you mean:
kill -0 $(cat /run/rpc.statd.pid) > /dev/null 2>&1Use quotes and $() as recommended.
Signed-off-by Ben Hutchings <[email protected]>Signed-off-by Salvatore Bonaccorso <[email protected]>
Committed (tag: nfs-utils-2-6-4-rc3)
steved.
Quoted 19 lines
--- utils/statd/start-statd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)utils/statd/start-statd +2
-2@@ -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