From 267d5b45d4c4e1f34e23359b77aa453ee6c017b2 Mon Sep 17 00:00:00 2001 From: Mathieu Arnold Date: Fri, 1 Jun 2018 16:20:39 +0000 Subject: [PATCH] SC2163: Exporting an expansion rather than a variable. export takes a variable name, but shellcheck has noticed that you give it an expanded variable instead. The problematic code does not export MYVAR but a variable called foo if any. Add exception when using indirections where the variable to extract is actually the value of the variable. PR: 227109 Submitted by: mat Sponsored by: Absolight --- Mk/Scripts/functions.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Mk/Scripts/functions.sh b/Mk/Scripts/functions.sh index 528c24a916ae..72ee5c3fe69e 100644 --- a/Mk/Scripts/functions.sh +++ b/Mk/Scripts/functions.sh @@ -197,6 +197,8 @@ export_ports_env() { value="$(eval echo \$${var})" if [ -n "${value}" ]; then + # shellcheck disable=SC2163 + # We want to export the variable which name is in var. export ${var} echo "export ${var}=\"${value}\"" fi