From a8df41cf1642134e467642658ffe3b1548612e4f Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Sun, 3 Apr 2011 05:13:43 -0700 Subject: Nicer format --- utils.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'utils.sh') 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" } -- cgit v1.2.3