summaryrefslogtreecommitdiff
path: root/git-status.sh
diff options
context:
space:
mode:
authorJason Riedy <ejr@EECS.Berkeley.EDU>2005-12-06 14:21:52 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-06 18:09:12 -0800
commit9754563ca9a99bc0fe233f43202af15704fbed4d (patch)
tree4d347609c38cb8f9ec23c28a9d56dea6bf0bd2af /git-status.sh
parente23eff8be92a2a2cb66b53deef020063cff285ed (diff)
downloadgit-9754563ca9a99bc0fe233f43202af15704fbed4d.tar.gz
Use printf rather than echo -n.
On AIX, there is no -n option to the system's echo. Instead, it needs the '\c' control character. We could replace echo -n "foo" with echo -e "foo\c" but printf is recommended by most man pages. Tested on AIX 5.3, Solaris 8, and Debian. [jc: futureproofed two instances that uses variable with '%s' so later feeding different messages would not break things too easily; others are emitting literal so whoever changes the literal ought to notice more easily so they are safe.] Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-status.sh')
-rwxr-xr-xgit-status.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-status.sh b/git-status.sh
index b90ffc198d..2dda0c505c 100755
--- a/git-status.sh
+++ b/git-status.sh
@@ -13,7 +13,7 @@ report () {
trailer=""
while read status name newname
do
- echo -n "$header"
+ printf '%s' "$header"
header=""
trailer="#
"
@@ -27,7 +27,7 @@ report () {
U ) echo "# unmerged: $name";;
esac
done
- echo -n "$trailer"
+ printf '%s' "$trailer"
[ "$header" ]
}