[PATCH] avoid echo -e, there are systems where it does not work

From: Alex Riesen <raa.lkml@gmail.com>
Date: 2006-02-13 05:05:34
FreeBSD 4.11 being one example: the built-in echo doesn't have -e,
and the installed /bin/echo does not do "-e" as well.
"printf" works, laking just "\e" and "\xAB'.

---

 git-tag.sh                         |    3 ++-
 t/t3001-ls-files-others-exclude.sh |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

b155e96dcb988b2533e8546666d0f045a36f594d
diff --git a/git-tag.sh b/git-tag.sh
index 6d0c973..c74e1b4 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -85,7 +85,8 @@ if [ "$annotate" ]; then
 	exit 1
     }
 
-    ( echo -e "object $object\ntype $type\ntag $name\ntagger $tagger\n";
+    ( printf 'object %s\ntype %s\ntag %s\ntagger %s\n\n' \
+	"$object" "$type" "$name" "$tagger";
       cat "$GIT_DIR"/TAG_FINALMSG ) >"$GIT_DIR"/TAG_TMP
     rm -f "$GIT_DIR"/TAG_TMP.asc "$GIT_DIR"/TAG_FINALMSG
     if [ "$signed" ]; then
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index fde2bb2..6979b7c 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -68,7 +68,7 @@ test_expect_success \
      diff -u expect output'
 
 # Test \r\n (MSDOS-like systems)
-echo -ne '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore
+printf '*.1\r\n/*.3\r\n!*.6\r\n' >.gitignore
 
 test_expect_success \
     'git-ls-files --others with \r\n line endings.' \
-- 
1.1.6.gd46b

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Feb 13 05:06:13 2006

This archive was generated by hypermail 2.1.8 : 2006-02-13 05:06:54 EST