![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Networking Support General Networking Support Forum |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) | ||
|
Registered User
Join Date: Mar 2007
Posts: 10
OS: fedora5
|
how to compare
Quote:
but how can i compare these last two prints of "etho" that is eth0:14562108 62251 0 0 0 0 0 0 7789381 41532 0 0 0 0 0 0 eth0:14562108 62251 0 0 0 0 0 0 7789381 41532 0 0 0 0 0 0 the above two lines comes when net is down. so, how can i compare these two lines programatically i tried like this Quote:
i have to store the previous prints also then ony i can compare prev. eth0 and present eth0 if these are not equal net is up else net is down help me in this way thank you in advance |
||
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Mar 2007
Posts: 10
OS: fedora5
|
thank you for quick replay
hi
some times it is not showing proper output i tried like this [root@localhost ~]# cat /proc/net/dev | grep eth0 | sed 's/^[ \t]*//' | cut -d" " -f2 6052555 some times it has spaces immediately after eth0: eth0: 6046602 20579 3302 73 1104 0 0 0 307233 some times it may have more one spaces, some times it has no spaces. can you please help me to get the number immediately after eth0: thank you in advance |
|
|
|
![]() |
| Thread Tools | |
|
|