[LTP] [PATCH v2] tcp_cmds/ping/ping02: Make it compatible with Busybox

Alexey Kodanev alexey.kodanev@oracle.com
Mon Nov 9 19:48:34 CET 2020


On 09.11.2020 21:27, Köry Maincent wrote:
>>
>> $PING -h 2>&1 | grep -q '[-]f' || ping_opts="-i 0.01 -p aa"
> 
> The grep in parameter is not working for all cases.
> For example the ping usage of my Ubuntu laptop is:
> Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface]
>             [-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
>             [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
>             [-w deadline] [-W timeout] [hop1 ...] destination
> 
> 
> I may use test like this:
> $PING -c 1 -f $ipaddr >/dev/null 2>&1 || ping_opts="-i 0.01 -p aa"
> 
> What do you think?
> 

Agree, in that case it's better to try ping with the option.


More information about the ltp mailing list