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