Never mind, I figured it out after some more searching and trying different things. Here's the working code, it can easily be changed to add more processes.
i want to fully undertand redirecting/piping. i know most of the basic stuff, like ls|less or cat file|grep hello etc etc. but there are a somethings like find / -name file 2>/dev/null. what's is the 2? i know it redirects the errors (at least Permission denied ones) to /dev/null (the unix... (3 Replies)
I am using pipes (specifically piping out) in Perl to put an array from one file into an array in a different file. I can't figure out how to transfer the array. I kow how to open the pipe : open (FILEHANDLE, "| file") or die~
but how do I transfer the array. I think it has something to do with... (1 Reply)
Hi
Long time since I did any shell scripting so please be gentle with me! :)
Just wanted to know whether it is possible to take the streaming output from a dvb card /dev/dvb/adapter0/ and using named pipes and tee to pass the outputs to mplayer and mencoder so as to watch and record a telly... (0 Replies)
All,
I am a UNIX novice with a question that I hope you can help me with.
I have a UNIX application called "Tole" that formats and displays specific information about customers. I can display the information for up to 30 customers by seperating customer IDs using commas in this format:
Tole -c... (3 Replies)
I've got a file with lots of commands I want to run in it. They're formatted like so:
cp /path/to/file /path/to/new/file
and on and on and on.
Hundreds of them.
Anyways, I'd like to execute them one at a time, then check what time it is, and repeat this process until 7am.
I can... (3 Replies)
Is anyone piping commands to ex from scripts?
I.E. echo '%s/change this/to that/\nwq' | ex file.name
I've been using it for years with AIX, Solaris, SGI, with variations ksh and Mandriva and others with pdksh. I've just started using CentOS with ksh and it no longer works. I've tried single... (2 Replies)
Hi All,
I am trying to perform the below csh code in Perl, but i am unfamiliar with Perl. Can anybody give me some advice on it ?
Csh Code:
cat filename |grep AAA| grep BBB| awk '{print("already_appended")' (11 Replies)
Hi,
I need to use a double grep so to speak. I need to grep for a particular item say BOB and then for each successful result I need to grep for another item say SMITH.
I tried grep "BOB" filename | grep "SMITH"
but it does not seem to work.
I can achieve my desired result using an... (12 Replies)
Hi everybody,
I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form).
I am trying to extract some ids from within this file, which have certain parameters.
For example, some Of my IDs have the term 'No hit results'... (1 Reply)
Hi! all here is my code
which is working fine no errors but I want to know how to take result and input to other program
awk 'FNR==1{i++}{LC=NR}
{for(k=1; k<=NF; k++) A=$k}
END{for (i=1;i<=LC;i++)
{
for(j=1;j<=LC;j++)
if(A=='$UID' && A>='$MX'+A &&... (7 Replies)
Discussion started by: Akshay Hegde
7 Replies
LEARN ABOUT CENTOS
ares_process
ARES_PROCESS(3) Library Functions Manual ARES_PROCESS(3)NAME
ares_process - Process events for name resolution
SYNOPSIS
#include <ares.h>
void ares_process(ares_channel channel, fd_set *read_fds,
fd_set *write_fds)
void ares_process_fd(ares_channel channel, ares_socket_t read_fd, ares_socket_t write_fd)
DESCRIPTION
The ares_process(3) function handles input/output events and timeouts associated with queries pending on the name service channel identi-
fied by channel. The file descriptor sets pointed to by read_fds and write_fds should have file descriptors set in them according to
whether the file descriptors specified by ares_fds(3) are ready for reading and writing. (The easiest way to determine this information is
to invoke select with a timeout no greater than the timeout given by ares_timeout(3) ).
The ares_process function will invoke callbacks for pending queries if they complete successfully or fail.
ares_process_fd(3) works the same way but acts and operates only on the specific file descriptors (sockets) you pass in to the function.
Use ARES_SOCKET_BAD for "no action". This function is of course provided to allow users of c-ares to void select() in their applications
and within c-ares.
EXAMPLE
The following code fragment waits for all pending queries on a channel to complete:
int nfds, count;
fd_set readers, writers;
struct timeval tv, *tvp;
while (1)
{
FD_ZERO(&readers);
FD_ZERO(&writers);
nfds = ares_fds(channel, &readers, &writers);
if (nfds == 0)
break;
tvp = ares_timeout(channel, NULL, &tv);
count = select(nfds, &readers, &writers, NULL, tvp);
ares_process(channel, &readers, &writers);
}
SEE ALSO ares_fds(3), ares_timeout(3)AUTHOR
Greg Hudson, MIT Information Systems
Copyright 1998 by the Massachusetts Institute of Technology.
25 July 1998 ARES_PROCESS(3)