summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils.sh b/utils.sh
index 8c3d633..cc50716 100644
--- a/utils.sh
+++ b/utils.sh
@@ -14,12 +14,16 @@ run_cmd ()
{
local cmd="$1"
local title="$2"
+ local len=`echo "$title" | wc -c`
+ len=$((40-$len))
+ local format = "%""$len""s"
- if ! eval $cmd >>$LOG 2>&1 ; then
- printf "%25s%15s\n" "'$title'" "FAIL"
+ echo -n "$title"
+ if ! eval $cmd >>$LOG 2>&1 ; then
+ printf "$format\n" "'$title'" "FAIL"
exit 1
fi
- printf "%25s%15s\n" "'$title'" "DONE"
+ printf "$format\n" "'$title'" "DONE"
}