Sorry for bad english.
I'm trying to determine whether iperf works or not.
so I decide to use cut and I found that the cut worked properly in normal result, but did not work when there was an error in the result.
Here is the example.
(Normal result of IPERF)
$iperf3 -c 192.168.1.100 -t 1 --connect-timeout 1000
Connecting to host 192.168.1.100, port 5201
...
and
(Normal result of IPERF with cut)
$iperf3 -c 192.168.1.100 -t 1 --connect-timeout 1000|head -1|cut -d ' ' -f2
to
It works perpectly when there's no error
But if there is an error in the results
(Error result of IPERF)
$iperf3 -c 192.168.1.150 -t 1 --connect-timeout 1000
iperf3: error - unable to connect to server: Connection timed out
then
(Normal result of IPERF with cut)
$iperf3 -c 192.168.1.150 -t 1 --connect-timeout 1000|head -1|cut -d ' ' -f2
iperf3: error - unable to connect to server: Connection timed out
I expected 'error' as an result but it just shows everything.
I wonder what did I miss and How can I get proper result.