[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <49ee2e2e-8fd3-dedd-8aac-566b6e0e07c9@tessares.net>
Date: Tue, 17 May 2022 09:01:26 +0200
From: Matthieu Baerts <matthieu.baerts@...sares.net>
To: Jakub Kicinski <kuba@...nel.org>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>
Cc: netdev@...r.kernel.org, Geliang Tang <geliang.tang@...e.com>,
davem@...emloft.net, pabeni@...hat.com, edumazet@...gle.com,
mptcp@...ts.linux.dev
Subject: Re: [PATCH net-next 1/3] selftests: mptcp: fix a mp_fail test warning
Hi Jakub,
Thank you for the review and for having applied the patches!
On 16/05/2022 22:13, Jakub Kicinski wrote:
> On Fri, 13 May 2022 17:21:13 -0700 Mat Martineau wrote:
>> tc -n $ns2 -j -s action show action pedit index 100 | \
>> + grep "packets" | \
>> sed 's/.*"packets":\([0-9]\+\),.*/\1/'
>
> sed can do the grepping for you:
>
> sed -n 's/.*"packets":\([0-9]\+\),.*/\1/p'
Yes, thank you, that would have been shorter!
> But really grepping JSON output seems weird. Why not use jq?
We started to use 'jq' because we originally had to extract a few values
from this command. At the end, we only needed to extract the number of
packets and we didn't want all MPTCP tests to depend on 'jq' just for that.
But because 'jq' is already needed for a few other selftests, next time
we need to parse a JSON, we should use 'jq'!
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Powered by blists - more mailing lists