From: Darshaka Pathirana Date: Fri, 4 Dec 2020 10:49:12 +0000 (+0100) Subject: usr_bin/grml-lang: Fix a couple of shellcheck warnings X-Git-Tag: v2.11.0~1^2~24 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=c6fa5b9b1a99cfd42fd9aa2c2ce465321f7845af 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. --- 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