From: Bart Van Assche Date: Fri, 28 Sep 2018 21:51:28 +0000 (-0700) Subject: t/zbd/functions: Make fio_reset_count() return 0 if no resets occurred X-Git-Tag: fio-3.11~13 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=1b412cb45ceb198b881e6c724f11daf28e831977 t/zbd/functions: Make fio_reset_count() return 0 if no resets occurred This patch avoids that certain bash versions report the following complaint: t/zbd/test-zbd-support: line 69: [: : integer expression expected Signed-off-by: Bart Van Assche Cc: Damien Le Moal Signed-off-by: Jens Axboe --- diff --git a/t/zbd/functions b/t/zbd/functions index 95f9bf45..173f0ca6 100644 --- a/t/zbd/functions +++ b/t/zbd/functions @@ -102,5 +102,8 @@ fio_written() { } fio_reset_count() { - sed -n 's/^.*write:[^;]*; \([0-9]*\) zone resets$/\1/p' + local count + + count=$(sed -n 's/^.*write:[^;]*; \([0-9]*\) zone resets$/\1/p') + echo "${count:-0}" }