diff options
| author | Andrew Tridgell <tridge@samba.org> | 2008-07-15 23:24:54 +1000 |
|---|---|---|
| committer | Andrew Tridgell <tridge@samba.org> | 2008-07-15 23:24:54 +1000 |
| commit | b8c2e8858928610ccb4eec9c034d4e5085572df6 (patch) | |
| tree | 4bc7f1f166652f6befdcd8af86a9c071eeacc7ec | |
| parent | 4dba26ab308502db2a4fa74b5924d69a2ccc7a33 (diff) | |
fixed the null sub problem
| -rw-r--r-- | functions | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -154,16 +154,16 @@ substitute_vars() {( touch sed.$$ for v in $VARS; do # variable variables are fun ..... - s=${!v:-__notset__} + [ "${!v+x}" ] || { + echo "ERROR: No substitution given for ${delim2}$v${delim2} in $infile" + exit 1 + } + s=${!v} # escape some pesky chars s=${s// /\\n} s=${s//#/\\#} s=${s//&/\\&} - [ "$s" = "__notset__" ] && { - echo "ERROR: No substitution given for ${delim2}$v${delim2} in $infile" - exit 1 - } echo "s#@@$v@@#$s#g" >> sed.$$ done |
