[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240509114212.4c8062b5@kernel.org>
Date: Thu, 9 May 2024 11:42:12 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Paolo Abeni <pabeni@...hat.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
shuah@...nel.org, ap420073@...il.com, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH net] selftests: net: move amt to socat for better
compatibility
On Thu, 09 May 2024 19:39:36 +0200 Paolo Abeni wrote:
> Acked-by: Paolo Abeni<pabeni@...hat.com>
Thanks!
> As a minor note, shell variable expansion should already trim all the
> trailing/leading spaces from the socat command output, so it should not
> be necessary replace the string comparison with the grep command:
>
> RESULT6=$(ip netns exec "${LISTENER}" timeout 15 socat - UDP6-LISTEN:6000,readbytes=128 || true)
> if [ "$RESULT6" == "2001:db8:3::2" ]; then
99% sure I tried that exact thing, but it wasn't enough.
$ msg=$(socat - UDP4-LISTEN:1234,readbytes=128)
$ echo ">$msg<"
>127.0.0.1 <
$ msg=$msg
$ echo ">$msg<"
>127.0.0.1 <
$ msg=$(echo $msg)
$ echo ">$msg<"
>127.0.0.1<
IOW we'd need to feed it thru an echo or some such.
Possibly something like: [ $(echo $msg) == "127.0.0.1" ]
But I personally find that a touch too magical.
The grep works 🤷️
Powered by blists - more mailing lists