fix bug where the countdown would be on multiple lines

Example of problem:

ATTENTION: Merging pull request #731 from remibergsma/centos7-kvm into 'master' 
branch in 5 seconds. CTRL+c to abort..
-n 5
-n 4
-n 3
-n 2
-n 1
-n 0

Should be compatible with more environments if printf is used instead.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9a24109f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9a24109f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9a24109f

Branch: refs/heads/master
Commit: 9a24109f9545b024e916b297a403bdd299ecba11
Parents: fed5c2b
Author: Remi Bergsma <[email protected]>
Authored: Mon Aug 24 13:42:48 2015 +0200
Committer: Remi Bergsma <[email protected]>
Committed: Mon Aug 24 16:00:48 2015 +0200

----------------------------------------------------------------------
 tools/git/git-pr | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a24109f/tools/git/git-pr
----------------------------------------------------------------------
diff --git a/tools/git/git-pr b/tools/git/git-pr
index 49eee79..2e0b275 100755
--- a/tools/git/git-pr
+++ b/tools/git/git-pr
@@ -207,10 +207,11 @@ echo "${prTitle}${prBody}" >> ${tmpMessageFile}
 echo "ATTENTION: Merging pull request #${prId} from ${prOriginBranch} into 
'${currentBranch}' branch in 5 seconds. CTRL+c to abort.."
 sec=5
 while [ $sec -ge 0 ]; do
-  echo -n "${sec} "
+  printf "${sec} "
   sec=$((sec-1))
   sleep 1
 done
+echo
 echo "INFO: Executing the merge now.. Git output below:"
 echo "INFO: 
***********************************************************************************"
 

Reply via email to