From 9a24109f9545b024e916b297a403bdd299ecba11 Mon Sep 17 00:00:00 2001 From: Remi Bergsma Date: Mon, 24 Aug 2015 13:42:48 +0200 Subject: [PATCH] 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. --- tools/git/git-pr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/git/git-pr b/tools/git/git-pr index 49eee799e97..2e0b275e86a 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: ***********************************************************************************"