summaryrefslogtreecommitdiff
path: root/utils.sh
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2011-04-03 05:13:43 -0700
committerAndreas Maunz <andreas@maunz.de>2011-04-03 05:13:43 -0700
commita8df41cf1642134e467642658ffe3b1548612e4f (patch)
tree899fbf07fbc7b15c6c64d28e2de80a7ae5ccad88 /utils.sh
parent5db1dc96ddf9f144b8c5a34404a46f9059f9c64e (diff)
Nicer format
Diffstat (limited to 'utils.sh')
-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"
}