gen_build_files.sh: simplify "print everything up to INSERT line" part
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 19 Oct 2011 19:17:20 +0000 (21:17 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 19 Oct 2011 19:17:20 +0000 (21:17 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
scripts/gen_build_files.sh

index 1a3d3e9b8998c2448784ac2d8be5ce63179bb131..c42fe9fbb4c133ebb31304dfbf511f64dc054587 100755 (executable)
@@ -27,11 +27,11 @@ generate()
                # rules re handling of "\n" in echo params.
                printf "%s\n" "${header}"
                # print everything up to INSERT line
-               sed -n '/^INSERT$/q;1,/^INSERT$/p' "${src}"
+               sed -n '/^INSERT$/ q; p' "${src}"
                # copy stdin to stdout
                cat
                # print everything after INSERT line
-               sed -n '/^INSERT$/{:l;n;p;bl}' "${src}"
+               sed -n '/^INSERT$/ { :l; n; p; bl }' "${src}"
        } >"${dst}.tmp"
        if ! cmp -s "${dst}" "${dst}.tmp"; then
                gen "${dst}"