Browse Source

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>
maint
Jason Riedy 19 years ago committed by Junio C Hamano
parent
commit
9754563ca9
  1. 2
      git-am.sh
  2. 2
      git-applypatch.sh
  3. 2
      git-bisect.sh
  4. 4
      git-status.sh

2
git-am.sh

@ -312,7 +312,7 @@ do
echo "--------------------------" echo "--------------------------"
cat "$dotest/final-commit" cat "$dotest/final-commit"
echo "--------------------------" 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 read reply
case "$reply" in case "$reply" in
[yY]*) action=yes ;; [yY]*) action=yes ;;

2
git-applypatch.sh

@ -83,7 +83,7 @@ while [ "$interactive" = yes ]; do
echo "--------------------------" echo "--------------------------"
cat "$final" cat "$final"
echo "--------------------------" 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 read reply
case "$reply" in case "$reply" in
y|Y) interactive=no;; y|Y) interactive=no;;

2
git-bisect.sh

@ -67,7 +67,7 @@ bisect_start() {
rm -rf "$GIT_DIR/refs/bisect/" rm -rf "$GIT_DIR/refs/bisect/"
mkdir "$GIT_DIR/refs/bisect" mkdir "$GIT_DIR/refs/bisect"
{ {
echo -n "git-bisect start" printf "git-bisect start"
sq "$@" sq "$@"
} >"$GIT_DIR/BISECT_LOG" } >"$GIT_DIR/BISECT_LOG"
sq "$@" >"$GIT_DIR/BISECT_NAMES" sq "$@" >"$GIT_DIR/BISECT_NAMES"

4
git-status.sh

@ -13,7 +13,7 @@ report () {
trailer="" trailer=""
while read status name newname while read status name newname
do do
echo -n "$header" printf '%s' "$header"
header="" header=""
trailer="# trailer="#
" "
@ -27,7 +27,7 @@ report () {
U ) echo "# unmerged: $name";; U ) echo "# unmerged: $name";;
esac esac
done done
echo -n "$trailer" printf '%s' "$trailer"
[ "$header" ] [ "$header" ]
} }



Loading…
Cancel
Save