From 749e305d3671368a8d08de002f5235298ed1ed53 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 24 Nov 2010 15:06:49 +0100 Subject: build system: fix for dash Signed-off-by: Denys Vlasenko --- scripts/gen_build_files.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/gen_build_files.sh b/scripts/gen_build_files.sh index 130269b10..ac8ccb933 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 -- cgit v1.2.3