Skip to content

Commit

Permalink
avoid echo -e, there are systems where it does not work
Browse files Browse the repository at this point in the history
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'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Feb 12, 2006
1 parent ef1af9d commit 0dbc4e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion git-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion t/t3001-ls-files-others-exclude.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.' \
Expand Down

0 comments on commit 0dbc4e8

Please sign in to comment.