From: David Gibson <david@gibson.dropbear.id.au>
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 [thread overview]
Message-ID: <YyHBdJETMhQQFbEd@yekko> (raw)
In-Reply-To: <20220914095755.2359997-1-sbrivio@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]
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 <sbrivio(a)redhat.com>
Reviewed-by: David Gibson <david(a)gibson.dropbear.id.au>
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-09-14 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 9:57 [PATCH] test: term: When checking if status line is a number, hide errors Stefano Brivio
2022-09-14 11:56 ` David Gibson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YyHBdJETMhQQFbEd@yekko \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).