*BSD News Article 92937


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.ececs.uc.edu!newsfeeds.sol.net!news.maxwell.syr.edu!news.idt.net!nntp.farm.idt.net!hq.idt.net!not-for-mail
From: Parthiv Shah <parthiv@hq.idt.net>
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: 1) redirect stdio beck to my c program, 2)how can I ping with alive ?
Date: 6 Apr 1997 14:30:40 GMT
Organization: IDT 
Lines: 26
Message-ID: <5i8c2g$ijb@nnrp2.farm.idt.net>
References: <5i7um2$hcs@beet.tau.ac.il>
NNTP-Posting-Host: hq.idt.net
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [UNIX 1.3 unoff BETA release 961025]
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:6597

Why use C while perl/expect or any other shell can do the job?

man xargs if you would like to do redirection for a shell..

If you are using C than you can always use functions such as 
system() and work with stdin,stdout and other file manipulation(s)...

e.g. call a function for ping, capture stdout into a file.. and do whatever.. 

Parthiv

Avidor Roye <roya@post.tau.ac.il> wrote:
<snip>
> So i started with that and have a little problems

> 	1) I need that the message from a ping will be alive or not and not

>                      continueing with all the messages follow,
> 	2) how can i ping some one from "c" program and redirect the output

>                 back to the program so i could test the results?
<snip>
--
 Parthiv Shah
 Work:	   parthiv@corp.idt.net			http://www.idt.net
 Personal: parthiv@netadmin.net			http://www.netadmin.net