[lang-ref] ( null_coalescing_alternative_2 ) ( bash )
@test "null coalescing alternative 2" {
# : "${x:=not set}"
# If unset or empty, assign default to x (and expand to that value).
# this is used for initialize value
unset x
: "${x:=not set}"
[ "$x" = "not set" ]
x=""
: "${x:=not set}"
[ "$x" = "not set" ]
x="test"
: "${x:=not set}"
[ "$x" = "test" ]
}