From 2029c4822b64ab0365340e35387bbcbd311b94b4 Mon Sep 17 00:00:00 2001 From: "t.feng" Date: Tue, 6 Dec 2022 21:49:28 +0800 Subject: [PATCH] util/bash-completion: Fix SC2070 shellcheck error 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 Reviewed-by: Daniel Kiper --- 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.47.2