Hi, I need help again. When I run this shell script, it only runs the unld_date.sql piece and exits. How can I structure this to run all the way to the end? When I don't have the unld_date.sql piece in here, everything runs fine from the date compare piece all the way to the end. Thanks in... (5 Replies)
Could anyone please help me. I have a function in plsql that returns a number. But i am listing some records through that function using DBMS_OUTPUT.PUT_LINE. I want to catch those records by executing this function through a unix script. The following shows what i did
echo "Connected from... (2 Replies)
Hello,
I want to know is it possible to pass a block of sentence using bash.
For example,
I have a script called Test.sh that takes in $1 and $2.
and I'm calling Test.sh in a.sh
so
in a.sh
Test.sh '' 'This is a sentence'
Because block are separated by space so when I do that, I get... (6 Replies)
Hi All,
I am supposed to present the documentation for the PLSQL code (PACKAGES, PROCEDURE, FUNCTIONS) of my application. There are sufficient comments in my code. Has anyone written any Shell Script Utility which can parse the PLSQL code and generate some kind of document ( preferrably HTML not... (1 Reply)
Hi all,
I need to pass a value from Unix to plsql block so that i can use the variable to in where caluse to get the desired output.
I tried useing $variable_name, but it doesn't work.
Any kind of help is appreciated.
Thanks in advance. (3 Replies)
I have written a script which works fine, to remove patterns contained in EXCLUDE.DAT from input.txt
awk 'BEGIN {n=0;while (getline < "EXCLUDE.DAT" > 0){ex=$0;n++}} {for(var in ex){print var "-" ex $0 ;i++}}' input.txt
The last problem I need to solve is how to pass the file... (3 Replies)
myscript.sh
#!/bin/bash
ARGA=$1
if ; then
echo "${ARGA}:Confirmed"
else
echo "${ARGA}:Unconfirmed"
fi
when I run the above script from the command line, i run it as:
./myscript.sh jsmith
now some times, i need to runn it this way: (8 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
2. Relevant commands, code, scripts, algorithms:
#! /bin/ksh
v="ORG_ID"
... (2 Replies)
I just want to make sure I am understanding how to pass a config file to a bash script . In the below I pass to arguments to a script, then define them in the script as id and config. I then source config using ., if I understand correctly the variables in the config file can now be used by the... (11 Replies)
Discussion started by: cmccabe
11 Replies
LEARN ABOUT PHP
pcap_loop
PCAP_LOOP(3PCAP)PCAP_LOOP(3PCAP)NAME
pcap_loop, pcap_dispatch - process packets from a live capture or savefile
SYNOPSIS
#include <pcap/pcap.h>
typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h,
const u_char *bytes);
int pcap_loop(pcap_t *p, int cnt,
pcap_handler callback, u_char *user);
int pcap_dispatch(pcap_t *p, int cnt,
pcap_handler callback, u_char *user);
DESCRIPTION
pcap_loop() processes packets from a live capture or ``savefile'' until cnt packets are processed, the end of the ``savefile'' is reached
when reading from a ``savefile'', pcap_breakloop() is called, or an error occurs. It does not return when live read timeouts occur. A
value of -1 or 0 for cnt is equivalent to infinity, so that packets are processed until another ending condition occurs.
pcap_dispatch() processes packets from a live capture or ``savefile'' until cnt packets are processed, the end of the current bufferful of
packets is reached when doing a live capture, the end of the ``savefile'' is reached when reading from a ``savefile'', pcap_breakloop() is
called, or an error occurs. Thus, when doing a live capture, cnt is the maximum number of packets to process before returning, but is not
a minimum number; when reading a live capture, only one bufferful of packets is read at a time, so fewer than cnt packets may be processed.
A value of -1 or 0 for cnt causes all the packets received in one buffer to be processed when reading a live capture, and causes all the
packets in the file to be processed when reading a ``savefile''.
(In older versions of libpcap, the behavior when cnt was 0 was undefined; different platforms and devices behaved differently, so code that
must work with older versions of libpcap should use -1, nor 0, as the value of cnt.)
callback specifies a pcap_handler routine to be called with three arguments: a u_char pointer which is passed in the user argument to
pcap_loop() or pcap_dispatch(), a const struct pcap_pkthdr pointer pointing to the packet time stamp and lengths, and a const u_char
pointer to the first caplen (as given in the struct pcap_pkthdr a pointer to which is passed to the callback routine) bytes of data from
the packet. The struct pcap_pkthdr and the packet data are not to be freed by the callback routine, and are not guaranteed to be valid
after the callback routine returns; if the code needs them to be valid after the callback, it must make a copy of them.
RETURN VALUE
pcap_loop() returns 0 if cnt is exhausted, -1 if an error occurs, or -2 if the loop terminated due to a call to pcap_breakloop() before any
packets were processed. It does not return when live read timeouts occur; instead, it attempts to read more packets.
pcap_dispatch() returns the number of packets processed on success; this can be 0 if no packets were read from a live capture (if, for
example, they were discarded because they didn't pass the packet filter, or if, on platforms that support a read timeout that starts before
any packets arrive, the timeout expires before any packets arrive, or if the file descriptor for the capture device is in non-blocking mode
and no packets were available to be read) or if no more packets are available in a ``savefile.'' It returns -1 if an error occurs or -2 if
the loop terminated due to a call to pcap_breakloop() before any packets were processed. If your application uses pcap_breakloop(), make
sure that you explicitly check for -1 and -2, rather than just checking for a return value < 0.
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), pcap_breakloop(3PCAP)
24 December 2008 PCAP_LOOP(3PCAP)