summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_build_files.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh
index 130269b..ac8ccb9 100755
--- a/scripts/gen_build_files.sh
+++ b/scripts/gen_build_files.sh
@@ -18,14 +18,17 @@ generate()
local src="$1" dst="$2" header="$3" insert="$4"
#chk "${dst}"
(
- echo "${header}"
+ # need to use printf: different shells have inconsistent
+ # rules re handling of "\n" in their params,
+ # and ${insert} definitely contains "\n"
+ printf "%s\n" "${header}"
if grep -qs '^INSERT$' "${src}"; then
sed -n '1,/^INSERT$/p' "${src}"
- echo "${insert}"
+ printf "%s\n" "${insert}"
sed -n '/^INSERT$/,$p' "${src}"
else
if [ -n "${insert}" ]; then
- echo "ERROR: INSERT line missing in: ${src}" 1>&2
+ printf "%s\n" "ERROR: INSERT line missing in: ${src}" 1>&2
fi
cat "${src}"
fi