Check numeric fields greater than zero, and delete lines if appropriate
This be the latest in my problems sorting through router logs... I'm half way there on a problem, but I've hit the limitation of my knowledge
Got some router interface log files of type
I don't care about frame errors or ignored errors, but I do want to take account of input errors, CRC errors and overrun errors, so I want to keep those lines (and the line above them) where those parameters are non zero, and I want to delete those lines where the important parameters are 0, and the lines above them. So... for the input above... I want the output to be
I'm thinking the way to do it is to sort for lines with the string "input errors", and check if the second, or fifth, or ninth parameters are non zero, and if so keep that line and the line above it, otherwise delete the line and the line above it.
I'm doing this on ubuntu... (may or may not be relevant)
Last edited by Franklin52; 11-11-2009 at 07:05 AM..
Reason: Please use code tags!
Hi,
how to check the given string is numeric or not , without converting ( using strtol...).
for ex: if string is C01 - non-numeric data
if string is 001 - numeric data
TIA (11 Replies)
i have a file in following format
1 32 3
4 6 4
4 45 1
45 4 61
54 66 4
5 65 51
56 65 1
12 32 85
now here the total number of lines are 8(they vary each time)
Now i want to select only those lines in which the values... (6 Replies)
Using shell,
I have a variable, how can I check that variable for a numeric value such as "41.0"? My program needs to do one things if the numeric value is found, and another if something else such as a string of letter is found. is there a specific character that denotes a numeral? The... (2 Replies)
HI All,
I have a file with contents like this:
apple
computer
terminal
applecomputernetworkrouterterminalrouter
network
router
applecomputernetworkrouterterminalrouter
I want to remove all lines with length greater than "18 alphabets". Hence, my output should be:
apple
computer... (1 Reply)
Hi, as the title states i need to find a way to search a column for values great than 1000, and if it is, then delete that row.
An example
1 7.021 6.967 116.019 4 U 6.980E+07 0.000E+00 e 0 0 0 0
2 8.292 7.908 118.063 3 U 1.440E+07 0.000E+00 e 0 821 814 ... (3 Replies)
Hello,
In my code I am checking to see if a variable that contains a decimal number is greater than 0 in the following manner:
if
do something
fi
However I am getting the error message (if $i for the current iteration holds 9.6352)
command 9.6352 is not found
How can I rectify... (5 Replies)
Hi all,
I have following scenario to perform sum aggregation on certain columns
Node Allocated_Space Pool_Name CS_Group Utilized Space
-------- ---------------- ---------- --------- --------------
bdw1a_lun01 300 bdw_p0 ... (2 Replies)
HI,
I have one file which is as below
cat /var/tmp/test1 | awk '{ print $3}'|grep -v affected
Data
----------
200.4
. The above 200 value is changable by the database script.
Now I need a script that checks the value 200.4 and the script shoud give out put if value is more than 225 (2 Replies)
Hi,
I am new to Shell scripts.
I have an urgent requirement to find the disk space using "df -k".
from that output,I need to check the used% whether greater than 85%.
if it is greater than 85% then need to delete my log files.
It is very urgent please some one help me.
Thanks in Advance... (1 Reply)
Hi,
I am new to Shell scripts.
I have an urgent requirement to find the disk space using "df -k".
from that output,I need to check the used% whether greater than 85%.
if it is greater than 85% then need to delete my log files.
It is very urgent please some one help me.
Thanks in Advance... (2 Replies)
Discussion started by: Anandbarnabas
2 Replies
LEARN ABOUT MINIX
irdpd
IRDPD(8) System Manager's Manual IRDPD(8)NAME
irdpd - internet router discovery protocol daemon
SYNOPSIS
irdpd [-bsd] [-U udp-device] [-I ip-device] [-o priority-offset]
DESCRIPTION
Irdpd looks for routers. This should be a simple task, but many routers are hard to find because they do not implement the router discov-
ery protocol. This daemon collects information that routers do send out and makes it available.
At startup irdpd sends out several router solicitation broadcasts. A good router should respond to this with a router advertisement.
If a router advertisement arrives then no more solicitations are sent. The TCP/IP server has filled its routing table with the info from
the advertisement, so it now has at least one router. If the advertisement is sent by a genuine router (the sender is in the table) then
the irdpd daemon goes dormant for the time the advert is valid. Routers send new adverts periodically, keeping the daemon silent.
Otherwise irdpd will listen for RIP (Router Information Protocol) packets. These packets are sent between routers to exchange routing
information. Irdpd uses this information to build a routing table.
Every now and then a router advertisement is sent to the local host to give it router information build from the RIP packets.
Lastly, if a router solicitation arrives and there is no router around that sends advertisements, then irdpd sends an advertisement to the
requestor. Note that this is a direct violation of RFC1256, as no host is supposed to sent those adverts. But alas the world is not
always perfect, and those adverts make booting hosts find routers quickly with this help from their brothers. (Of course, they will lose
the router soon if they don't have an irdpd daemon themselves.)
OPTIONS -b Broadcast advertisements instead of sending them to the local host only. This may be used to keep (non-Minix) hosts alive on a net
without adverts.
-s Be silent, do not send advertisements to hosts that ask for them.
-d Debug mode, tell where info is coming from and where it is sent. Debugging can also be turned on at runtime by sending signal
SIGUSR1 or turned off with SIGUSR2.
-o priority-offset
Offset used to make the gateway's preferences collected from RIP packets look worse than those found in genuine router adverts. By
default -1024.
SEE ALSO set_net_default(8), boot(8), inetd(8), nonamed(8), rarpd(8).
BUGS
Under standard Minix this daemon can't listen to two both IRDP and RIP at the same time, so it starts out with IRDP. It switches over to
RIP if it can't find a router, or if it threatens to lose its router. It does not switch back.
Irdpd may help a host that should not be helped, i.e. if it doesn't have an irdpd daemon with RIP collecting trickery. It will make System
Administrators pull out their remaining hair trying to find out why a host can access outside networks for a some time after boot, but goes
blind afterwards.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
IRDPD(8)