Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oa5U4-0001bc-00 for mharc-grub-devel@gnu.org; Sun, 18 Sep 2022 21:22:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa5U2-0001bK-GV for grub-devel@gnu.org; Sun, 18 Sep 2022 21:22:02 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:3877) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oa5Tz-0003l1-SI for grub-devel@gnu.org; Sun, 18 Sep 2022 21:22:02 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MW6H66Ddyz14QN5; Mon, 19 Sep 2022 09:17:38 +0800 (CST) Received: from kwepemm600019.china.huawei.com (7.193.23.64) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 09:21:42 +0800 Received: from huawei.com (10.44.134.232) by kwepemm600019.china.huawei.com (7.193.23.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 19 Sep 2022 09:21:42 +0800 From: t.feng To: CC: , , , Subject: [PATCH 1/2] bash-completion:fix shellcheck error Date: Mon, 19 Sep 2022 09:20:13 +0800 Message-ID: <20220919012014.499082-2-fengtao40@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220919012014.499082-1-fengtao40@huawei.com> References: <20220919012014.499082-1-fengtao40@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.44.134.232] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600019.china.huawei.com (7.193.23.64) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.255; envelope-from=fengtao40@huawei.com; helo=szxga08-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2022 01:22:02 -0000 SC2070 (error): -n doesn't work with unquoted arguments. Quote or use [[ ]]. In grub-completion.bash.in line 130: [ -n $tmp ] && { ^--^ SC2070 (error) ref:https://github.com/koalaman/shellcheck/wiki/SC2070 --- 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