From bdb6d4ec8eaac4d01ace50bd521c79f8d4b2d8d5 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 26 Feb 2008 10:42:54 +0100 Subject: [PATCH] Replace head -1 | grep by sed. Signed-off-by: Johannes Sixt --- templates/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/Makefile b/templates/Makefile index 0ed2f35003..eb0870235d 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -34,10 +34,10 @@ boilerplates.made : $(bpsrc) mkdir -p blt/$$dir && \ case "$$boilerplate" in \ *--) ;; \ - *) if head -1 $$boilerplate | grep -q '^#!/'; then \ - cp $$boilerplate blt/$${dst}$(NOEXECTEMPL); \ + *) if test -n "$$(sed -ne '/^#!\//p' -e '1q' < "$$boilerplate")"; then \ + cp "$$boilerplate" "blt/$${dst}$(NOEXECTEMPL)"; \ else \ - cp $$boilerplate blt/$$dst; \ + cp "$$boilerplate" "blt/$$dst"; \ fi ;; \ esac || exit; \ done && \