Sponsored Content
Top Forums Shell Programming and Scripting Extremely rusty on my scripting and need help! Post 302384476 by scottzx7rr on Tuesday 5th of January 2010 12:10:52 PM
Old 01-05-2010
Sorry I had a lot of detail in the first post that got wiped somehow. I am in need of the line entries from the log file that follow the Interface Data Line so that i could report on dropped packets. So I need the complete lines for the interfaces so that I can review and see if there is any dropped packets. I ended up finding some old sed commands from some of my older scripts and it will work for the extraction but see if there is something cleaner to keep for the formating of the lines from the orginal data file into the new file. Cause it currently pulls it but outputs it into a single string.

Here is what I have found and am trying to use.

DRPPKT=`sed -n '/( interface data )/,/( interface trunks )/p' filename`
echo ${DRPPKT}
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extremely headache

I need to execute command at remote host from my program. there is rs6000/aix standard command called rexec. unfortunately rexec ask username and password which must supplied interactively, of course it is impossible runned by program. So I have to change rexec command format to make user-name... (5 Replies)
Discussion started by: yatno
5 Replies

2. UNIX for Dummies Questions & Answers

Extremely Interested

As i was reading an article on being a "HACKERS" which was 30 minutes ago thinking that HACKING was the same as CRACKING, after the reading i discovered their difference, a hacker builds the internet while crackers just cracks and annoy like phreaking and breaking into people's computer. That... (5 Replies)
Discussion started by: Punk18
5 Replies

3. UNIX for Dummies Questions & Answers

extremely new to unix, need help

Hi, I'm really new and I need help with UNIX. I'm not sure how to use FILE * fp properly, I don't know how to use loops, I don't know how to using i++ or ++i to do things like count the number of scans and print it out, and I don't know how to call functions and use them. I really only know how to... (1 Reply)
Discussion started by: s2pids2pid
1 Replies

4. UNIX for Dummies Questions & Answers

Extremely New

I just loaded Cygwin on my XP deskop. I am TRYING to install a program that said it needs this program to run. How do I install or run a program? Keep in mind I just started with Unix yesterday:) (1 Reply)
Discussion started by: gss
1 Replies

5. UNIX for Dummies Questions & Answers

help with extremely basic problem

Alright i'm having problems with this loop. Basically once the script is ran a parameter is required. Once entering the parameter it displays that in LIMIT. Alright so now the problem, I need my loop to ask my user for a number, and if that number is less than the limit then sum the input values... (4 Replies)
Discussion started by: tragic54
4 Replies

6. Solaris

Re-sync Taking Extremely Long.

It's almost 3 days now and my resync/re-attach is only at 80%. Is there something I can check in Solaris 10 that would be causing the degradation. It's only a standby machine. My live system completed in 6hrs. (9 Replies)
Discussion started by: ravzter
9 Replies

7. UNIX for Dummies Questions & Answers

rusty with cp command -- how to cp all .doc files with .txt extension

I'm rusty with cp, so I was wondering: is it possible to cp all the .doc files in a folder and make them .txt files? Can you use cp to do that? (3 Replies)
Discussion started by: Straitsfan
3 Replies

8. Programming

Working with extremely large numbers in C

Hi All, I am just curious, not programming anything of my own. I know there are libraries like gmp which does all such things. But I really need to know HOW they do all such things i.e. working with extremely large unimaginable numbers which are beyond the integer limit. They can do add,... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

9. UNIX for Dummies Questions & Answers

Extremely New to Shell Scripts

I am sorry if this qeustion is silly. (Please see Title of this thread.) Is it possible to build a shell script that 1) runs a nawk command that I know works, to analyze a column of data and 2) after that column is analyzed, if the result is over a certain level, send an email with the... (2 Replies)
Discussion started by: he204035
2 Replies
PCAP_STATS(3PCAP)														 PCAP_STATS(3PCAP)

NAME
pcap_stats - get capture statistics SYNOPSIS
#include <pcap/pcap.h> int pcap_stats(pcap_t *p, struct pcap_stat *ps); DESCRIPTION
pcap_stats() fills in the struct pcap_stat pointed to by its second argument. The values represent packet statistics from the start of the run to the time of the call. pcap_stats() is supported only on live captures, not on ``savefiles''; no statistics are stored in ``savefiles'', so no statistics are available when reading from a ``savefile''. A struct pcap_stat has the following members: ps_recv number of packets received; ps_drop number of packets dropped because there was no room in the operating system's buffer when they arrived, because packets weren't being read fast enough; ps_ifdrop number of packets dropped by the network interface or its driver. The statistics do not behave the same way on all platforms. ps_recv might count packets whether they passed any filter set with pcap_set- filter(3PCAP) or not, or it might count only packets that pass the filter. It also might, or might not, count packets dropped because there was no room in the operating system's buffer when they arrived. ps_drop is not available on all platforms; it is zero on platforms where it's not available. If packet filtering is done in libpcap, rather than in the operating system, it would count packets that don't pass the filter. Both ps_recv and ps_drop might, or might not, count packets not yet read from the operating system and thus not yet seen by the application. ps_ifdrop might, or might not, be implemented; if it's zero, that might mean that no packets were dropped by the interface, or it might mean that the statistic is unavailable, so it should not be treated as an indication that the interface did not drop any packets. RETURN VALUE
pcap_stats() returns 0 on success and returns -1 if there is an error or if p doesn't support packet statistics. If -1 is returned, pcap_geterr() or pcap_perror() may be called with p as an argument to fetch or display the error text. SEE ALSO
pcap(3PCAP), pcap_geterr(3PCAP) 7 September 2009 PCAP_STATS(3PCAP)
All times are GMT -4. The time now is 01:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy