From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH] test: term: When checking if status line is a number, hide errors Date: Wed, 14 Sep 2022 21:56:36 +1000 Message-ID: In-Reply-To: <20220914095755.2359997-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5257729617035705949==" --===============5257729617035705949== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Wed, Sep 14, 2022 at 11:57:55AM +0200, Stefano Brivio wrote: > We use the [ "$x" -eq "$x" ] syntax to check if $x is a number. The > behaviour is clearly implied by POSIX, but some shells might actually > report the (intended) error, and dash floods script.log with > "Illegal number" error messages. Hide them. > > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson I see a bunch of these errors and it would be nice to get rid of them. > --- > test/lib/term | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/test/lib/term b/test/lib/term > index b31deac..eade2cd 100755 > --- a/test/lib/term > +++ b/test/lib/term > @@ -232,7 +232,7 @@ pane_status() { > [ ${DEMO} -eq 1 ] && return 0 > > __status="$(pane_parse "${1}")" > - while ! [ "${__status}" -eq "${__status}" ]; do > + while ! [ "${__status}" -eq "${__status}" ] 2>/dev/null; do > sleep 1 > pane_run "${1}" 'echo $?' > pane_wait "${1}" -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --===============5257729617035705949== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1NaHdWc0FDZ2tRZ3lwWTRnRXcKWVNJMGNBLytLM29naVMwNEhG b0FYempJblRsSnhocGpwSW5EeGZnUzl6Njd0YUpze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