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>
Jason Riedy committed
Dec 6, 2005 at 14:21 UTC
9754563ca9a99bc0fe233f43202af15704fbed4d
4 files changed
+5
-5
git-am.sh
+1
-1
@@ -312,7 +312,7 @@ do
312
echo "--------------------------"
313
cat "$dotest/final-commit"
314
echo "--------------------------"
315
- echo -n "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
315
+ printf "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
316
read reply
317
case "$reply" in
318
[yY]*) action=yes ;;
git-applypatch.sh
+1
-1
@@ -83,7 +83,7 @@ while [ "$interactive" = yes ]; do
83
echo "--------------------------"
84
cat "$final"
85
echo "--------------------------"
86
- echo -n "Apply? [y]es/[n]o/[e]dit/[a]ccept all "
86
+ printf "Apply? [y]es/[n]o/[e]dit/[a]ccept all "
87
read reply
88
case "$reply" in
89
y|Y) interactive=no;;
git-bisect.sh
+1
-1
@@ -67,7 +67,7 @@ bisect_start() {
67
rm -rf "$GIT_DIR/refs/bisect/"
68
mkdir "$GIT_DIR/refs/bisect"
69
{
70
- echo -n "git-bisect start"
70
+ printf "git-bisect start"
71
sq "$@"
72
} >"$GIT_DIR/BISECT_LOG"
73
sq "$@" >"$GIT_DIR/BISECT_NAMES"
git-status.sh
+2
-2
@@ -13,7 +13,7 @@ report () {
13
trailer=""
14
while read status name newname
15
do
16
- echo -n "$header"
16
+ printf '%s' "$header"
17
header=""
18
trailer="#
19
"
@@ -27,7 +27,7 @@ report () {
27
U ) echo "# unmerged: $name";;
28
esac
29
done
30
- echo -n "$trailer"
30
+ printf '%s' "$trailer"
31
[ "$header" ]
32
}
33