summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-07-15 23:24:54 +1000
committerAndrew Tridgell <tridge@samba.org>2008-07-15 23:24:54 +1000
commitb8c2e8858928610ccb4eec9c034d4e5085572df6 (patch)
tree4bc7f1f166652f6befdcd8af86a9c071eeacc7ec
parent4dba26ab308502db2a4fa74b5924d69a2ccc7a33 (diff)
fixed the null sub problem
-rw-r--r--functions10
1 files changed, 5 insertions, 5 deletions
diff --git a/functions b/functions
index 9cc2c8d..94d199f 100644
--- a/functions
+++ b/functions
@@ -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