grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH V3 1/4] bash-completion:fix shellcheck error


From: t . feng
Subject: [PATCH V3 1/4] bash-completion:fix shellcheck error
Date: Tue, 6 Dec 2022 21:49:28 +0800

SC2070 (error): -n doesn't work with unquoted arguments.
Quote or use [[ ]].
In grub-completion.bash.in line 130:
             [ -n $tmp ] && {
                  ^--^ SC2070 (error)

More: https://github.com/koalaman/shellcheck/wiki/SC2070

Signed-off-by: "t.feng" <fengtao40@huawei.com>
---
 util/bash-completion.d/grub-completion.bash.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/bash-completion.d/grub-completion.bash.in 
b/util/bash-completion.d/grub-completion.bash.in
index 44bf135b9..93d143480 100644
--- a/util/bash-completion.d/grub-completion.bash.in
+++ b/util/bash-completion.d/grub-completion.bash.in
@@ -127,7 +127,7 @@ __grub_list_modules () {
     local IFS=$'\n'
     COMPREPLY=( $( compgen -f -X '!*/*.mod' -- "${grub_dir}/$cur" | {
          while read -r tmp; do
-             [ -n $tmp ] && {
+             [ -n "$tmp" ] && {
                  tmp=${tmp##*/}
                  printf '%s\n' ${tmp%.mod}
              }
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]