substitute(): --subst-var was silently coercing to "" if the variable does not exist.
This commit is contained in:
parent
4bd4e3ef5c
commit
0de0ce5893
@ -661,6 +661,10 @@ substituteStream() {
|
|||||||
echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2
|
echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if [ -z ${!varName+x} ]; then
|
||||||
|
echo "substituteStream(): ERROR: variable \$$varName is unset" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
pattern="@$varName@"
|
pattern="@$varName@"
|
||||||
replacement="${!varName}"
|
replacement="${!varName}"
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user