Dear,
I want to perform a plotting using xgraph, and the plotting data (ping.txt) is as below. For the graph I just want to plot the time for x-axis (line count) and the RTT for y-axis (time in ms). Below are script i write for that purpose but it seen did not work. Any guide for me because i think the script is wrong. The example of plot is about like this:
ping.txt
-------------------------------------------------------------
64 bytes from 192.168.1.100: icmp_seq=0 ttl=255 time=
0.712 ms
64 bytes from 192.168.1.100: icmp_seq=1 ttl=255 time=
0.620 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=255 time=
0.698 ms
64 bytes from 192.168.1.100: icmp_seq=3 ttl=255 time=
0.662 ms
64 bytes from 192.168.1.100: icmp_seq=4 ttl=255 time=
0.649 ms
-------------------------------------------------------------
Quote:
#!/bin/sh
#For x-axis (Time)
wc -l ping.txt > plot.txt
#For y-axis (RTT)
ping.txt | awk '{print $7}' > plot.txt
#Plotting graph using xgraph
xgraph -bb -tk -x "Time" -y "RTT" plot.txt
Intended plot.txt
-----------------
1
0.712
2
0.620
3
0.698
4
0.662
5
0.649
-----------------