diff options
author | Jason Riedy <ejr@EECS.Berkeley.EDU> | 2005-12-06 14:21:52 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-12-06 18:09:12 -0800 |
commit | 9754563ca9a99bc0fe233f43202af15704fbed4d (patch) | |
tree | 4d347609c38cb8f9ec23c28a9d56dea6bf0bd2af | |
parent | qsort() ptrdiff_t may be larger than int (diff) | |
download | tgif-9754563ca9a99bc0fe233f43202af15704fbed4d.tar.xz |
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>
-rwxr-xr-x | git-am.sh | 2 | ||||
-rwxr-xr-x | git-applypatch.sh | 2 | ||||
-rwxr-xr-x | git-bisect.sh | 2 | ||||
-rwxr-xr-x | git-status.sh | 4 |
4 files changed, 5 insertions, 5 deletions
@@ -312,7 +312,7 @@ do echo "--------------------------" cat "$dotest/final-commit" echo "--------------------------" - echo -n "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all " + printf "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all " read reply case "$reply" in [yY]*) action=yes ;; diff --git a/git-applypatch.sh b/git-applypatch.sh index 4c577eb835..a112e1a504 100755 --- a/git-applypatch.sh +++ b/git-applypatch.sh @@ -83,7 +83,7 @@ while [ "$interactive" = yes ]; do echo "--------------------------" cat "$final" echo "--------------------------" - echo -n "Apply? [y]es/[n]o/[e]dit/[a]ccept all " + printf "Apply? [y]es/[n]o/[e]dit/[a]ccept all " read reply case "$reply" in y|Y) interactive=no;; diff --git a/git-bisect.sh b/git-bisect.sh index 68838f3fad..05dae8ad13 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -67,7 +67,7 @@ bisect_start() { rm -rf "$GIT_DIR/refs/bisect/" mkdir "$GIT_DIR/refs/bisect" { - echo -n "git-bisect start" + printf "git-bisect start" sq "$@" } >"$GIT_DIR/BISECT_LOG" sq "$@" >"$GIT_DIR/BISECT_NAMES" 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" ] } |