diff options
author | Martin Schwenke <martin@meltin.net> | 2022-05-27 23:23:48 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2022-07-22 16:09:31 +0000 |
commit | db37043bc5c67e536bcaaf1941cb12ec2e72efc9 (patch) | |
tree | e61914f3cdf82eabd53d5ab81e234ff377702013 /ctdb/tests/scripts/integration.bash | |
parent | 00f1d6d94764ba1312500c72fd08e7df3fae064b (diff) | |
download | samba-db37043bc5c67e536bcaaf1941cb12ec2e72efc9.tar.gz |
ctdb-scripts: Avoid ShellCheck warning SC2295
For example:
In /home/martins/samba/samba/ctdb/tools/onnode line 304:
[ "$nodes" != "${nodes%[ ${nl}]*}" ] && verbose=true
^---^ SC2295 (info): Expansions inside ${..} need to be quoted separately, otherwise they match as patterns.
Did you mean:
[ "$nodes" != "${nodes%[ "${nl}"]*}" ] && verbose=true
For more information:
https://www.shellcheck.net/wiki/SC2295 -- Expansions inside ${..} need to b...
Who knew? Thanks ShellCheck!
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests/scripts/integration.bash')
-rw-r--r-- | ctdb/tests/scripts/integration.bash | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash index dbf9af0b346..65e974e4e36 100644 --- a/ctdb/tests/scripts/integration.bash +++ b/ctdb/tests/scripts/integration.bash @@ -469,8 +469,10 @@ node_has_status () while read -r line ; do # This needs to be done in 2 steps to # avoid false matches. - local line_bits="${line#|${pnn}|*|}" + local line_bits="${line#|"${pnn}"|*|}" [ "$line_bits" = "$line" ] && continue + # shellcheck disable=SC2295 + # This depends on $bits being a pattern [ "${line_bits#${bits}}" != "$line_bits" ] && \ return 0 done |