From 7c7782016b9ca546ae826249e5f2d5ce74bce931 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 20 Feb 2020 09:39:18 -0800 Subject: [PATCH] Updated SC2154 (markdown) --- SC2154.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SC2154.md b/SC2154.md index ebe1cc5..9bd3db7 100644 --- a/SC2154.md +++ b/SC2154.md @@ -52,4 +52,4 @@ 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), or explicitly initialize/declare it with `var=""` or `declare var`. You can also disable the message with a [[directive]]. +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]].