1
0
mirror of https://passt.top/passt synced 2024-06-29 22:42:46 +00:00

test: term: When checking if status line is a number, hide errors

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@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Stefano Brivio 2022-09-14 11:52:14 +02:00
parent 9fc476af6e
commit b323e5f439

View File

@ -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}"