Skip to content

Commit 9754563

Browse files
Jason RiedyJunio C Hamano
authored andcommitted
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>
1 parent e23eff8 commit 9754563

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

git-am.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ do
312312
echo "--------------------------"
313313
cat "$dotest/final-commit"
314314
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 "
316316
read reply
317317
case "$reply" in
318318
[yY]*) action=yes ;;

git-applypatch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ while [ "$interactive" = yes ]; do
8383
echo "--------------------------"
8484
cat "$final"
8585
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 "
8787
read reply
8888
case "$reply" in
8989
y|Y) interactive=no;;

git-bisect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bisect_start() {
6767
rm -rf "$GIT_DIR/refs/bisect/"
6868
mkdir "$GIT_DIR/refs/bisect"
6969
{
70-
echo -n "git-bisect start"
70+
printf "git-bisect start"
7171
sq "$@"
7272
} >"$GIT_DIR/BISECT_LOG"
7373
sq "$@" >"$GIT_DIR/BISECT_NAMES"

git-status.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ report () {
1313
trailer=""
1414
while read status name newname
1515
do
16-
echo -n "$header"
16+
printf '%s' "$header"
1717
header=""
1818
trailer="#
1919
"
@@ -27,7 +27,7 @@ report () {
2727
U ) echo "# unmerged: $name";;
2828
esac
2929
done
30-
echo -n "$trailer"
30+
printf '%s' "$trailer"
3131
[ "$header" ]
3232
}
3333

0 commit comments

Comments
 (0)