From c6fa5b9b1a99cfd42fd9aa2c2ce465321f7845af Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Fri, 4 Dec 2020 11:49:12 +0100 Subject: [PATCH] usr_bin/grml-lang: Fix a couple of shellcheck warnings - SC2034: PN appears unused. Verify use (or export if used externally). - SC2086: Double quote to prevent globbing and word splitting. - Ignore SC1091: Not following: /etc/grml/language-functions was not specified as input (see shellcheck -x). SC1117 was retired due to noise in koalaman/shellcheck@d8a32da07. --- Makefile | 2 +- usr_bin/grml-lang | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6e0dc8d..82019a7 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ all: codecheck spellcheck ## Run codecheck and spellcheck codecheck: shellcheck pythoncheck ## Run shellcheck and pythoncheck shellcheck: ## Run shellcheck - for shellfile in usr_bin/* usr_sbin/* usr_share/*; do head -1 "$${shellfile}" | grep -q "/bin/bash\|/bin/sh" && shellcheck "$${shellfile}"; done + for shellfile in usr_bin/* usr_sbin/* usr_share/*; do head -1 "$${shellfile}" | grep -q "/bin/bash\|/bin/sh" && shellcheck -x "$${shellfile}"; done .ONESHELL: pythoncheck: ## Run shellcheck diff --git a/usr_bin/grml-lang b/usr_bin/grml-lang index 0e774ae..52b81a0 100755 --- a/usr_bin/grml-lang +++ b/usr_bin/grml-lang @@ -7,10 +7,10 @@ ################################################################################ CONFFILE=/etc/default/keyboard -PN="$(basename $0)" +PN="$(basename "$0")" usage(){ - echo "Usage: $0 " + echo "Usage: ${PN} " echo "supported values: at, ch, de, dvorak, es, fr, it, jp, us" } @@ -26,6 +26,7 @@ fi LANGUAGE="$1" +# shellcheck disable=SC1091 . /etc/grml/language-functions if [ -n "$XKEYBOARD" ] ; then -- 2.1.4