From 9cfa9fdb2964a11b58151b22dff9cbb2e920e9d6 Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Mon, 1 Feb 2021 14:46:53 +0200 Subject: [PATCH] Updated SC2154 (markdown) --- SC2154.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SC2154.md b/SC2154.md index e2e6993..4492210 100644 --- a/SC2154.md +++ b/SC2154.md @@ -53,3 +53,11 @@ Note: This message only triggers for variables with lowercase characters in thei ShellCheck intentionally does not attempt to figure out runtime or dynamic assignments like with `source "$(date +%F).sh"` or `eval var=value`. See [[SC2034]] for an extended discussion of why this is the case. If you know for a fact that the variable is set, you can use `${var:?}` to fail if the variable is unset (or empty), initialize it to a default value if uninitialized with `: "${var:=}"`, or explicitly initialize/declare it with `var=""` or `declare var`. You can also disable the message with a [[directive]]. + +--- + +## Read more: + +POSIX - Parameter expansion: +* https://stackoverflow.com/a/16753536/2309247 +* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 \ No newline at end of file