From fdcff5481a8611f240bc00ea5175faeb9fa2262e Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Mon, 20 Jun 2022 21:29:30 +0200 Subject: check: simplify check.time parsing There's no need to use grep and awk when the latter can do all that's needed, including the pretty printing. Signed-off-by: David Disseldorp Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- check | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'check') diff --git a/check b/check index 42925e09..43c072d2 100755 --- a/check +++ b/check @@ -819,13 +819,9 @@ function run_section() try="$try $seqnum" n_try=`expr $n_try + 1` - # slashes now in names, sed barfs on them so use grep - lasttime=`grep -w ^$seqnum $check.time | awk '// {print $2}'` - if [ "X$lasttime" != X ]; then - echo -n " ${lasttime}s ... " - else - echo -n " " # prettier output with timestamps. - fi + awk 'BEGIN {lasttime=" "} \ + $1 == "'$seqnum'" {lasttime=" " $2 "s ... "; exit} \ + END {printf "%s", lasttime}' "$check.time" rm -f core $seqres.notrun start=`_wallclock` -- cgit v1.2.3