diff options
author | Andreas Maunz <andreas@maunz.de> | 2011-04-03 05:13:43 -0700 |
---|---|---|
committer | Andreas Maunz <andreas@maunz.de> | 2011-04-03 05:13:43 -0700 |
commit | a8df41cf1642134e467642658ffe3b1548612e4f (patch) | |
tree | 899fbf07fbc7b15c6c64d28e2de80a7ae5ccad88 /utils.sh | |
parent | 5db1dc96ddf9f144b8c5a34404a46f9059f9c64e (diff) |
Nicer format
Diffstat (limited to 'utils.sh')
-rw-r--r-- | utils.sh | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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" } |