Update Regexp to not match ${_} for replacement

This commit is contained in:
Germain Masse 2017-08-21 09:34:44 +02:00 committed by GitHub
parent 0289532f18
commit 38622845a8

View File

@ -40,7 +40,7 @@ function templater() {
fi
cp -f "${templateSrc}" "${templateDst}"
for var in $(env |awk -F= '{print $1}' |grep -E '^[A-Z0-9_]+$'); do
for var in $(env |awk -F= '{print $1}' |grep -E '^(_[A-Z0-9_]+|[A-Z0-9][A-Z0-9_]*)$'); do
sed -i.bak -e "s#\${${var}}#${!var}#g" "${templateDst}"
# this .bak dance is done for BSD/GNU portability: http://stackoverflow.com/a/22084103/151666
rm -f "${templateDst}.bak"