Commit 163fbd8
Ian Campbell
boot.sh: Correct use of "Alternate Value" expansion
Using `${var:+alt}` expands to the alternative value for variables which set
_and_ non-empty, while `${var+alt}` expands to the alternative value for
variables which are set, even if they are empty.
$ ( foo="abc" ; bar="" ; echo "FOO: \"${foo+set}\" \"${foo:+set}\""; echo "BAR: \"${bar+set}\" \"${bar:+set}\""; echo "BAZ: \"${baz+set}\" \"${baz:+set}\"" )
FOO: "set" "set"
BAR: "set" ""
BAZ: "" ""
The `${var:+alt}` semantics is what is needed here, it only really matters if
the variable (`${kubeadm_data}` in this case) is ever set to `""`, which it
never is here, but correct it anyway to avoid a potential future pitfall.
Signed-off-by: Ian Campbell <ijc@docker.com>1 parent 0d844b0 commit 163fbd8
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
0 commit comments