我需要帮助才能在使用 sed ping 时仅提取时间值。
ping 192.168.1.1
PING 192.168.1.11 (192.168.1.11) 56(84) bytes of data.
64 bytes from 192.168.1.11: icmp_seq=1 ttl=64 time=0.028 ms
64 bytes from 192.168.1.11: icmp_seq=2 ttl=64 time=0.027 ms
64 bytes from 192.168.1.11: icmp_seq=3 ttl=64 time=0.024 ms
64 bytes from 192.168.1.11: icmp_seq=4 ttl=64 time=0.031 ms
Run Code Online (Sandbox Code Playgroud)
所以在使用 sed 后,我想得到以下输出:
ping 192.168.1.1 | sed '???'
0.028
0.027
0.024
0.031
Run Code Online (Sandbox Code Playgroud)
谢谢!
command-line ×1