Home  |  Linux  | Mysql  | PHP  | XML
From:Jim Gibson Date:Mon Feb  8 19:06:10 2010
Subject:Re: sequential value check
On 2/8/10 Mon  Feb 8, 2010  3:55 PM, "Curt Shaffer" <cshaffer@gmail.com>
scribbled:

> OK. So I have tried some things. I guess the largest issue that I can't find
> an answer for elsewhere is how to evaluate variables to be >, = or <100 in one
> evaluation.
> 
> Before I get there, obviously I need to get the variables.
> 
> Here is what I am trying to do for that:
> 
> @hping_array = ();
> $hcount = 1;
> for (; $hcount < 5;){
> 
>         system ("sudo hping3 $domain -S -p 80 -c 1|awk '{print $5}'");
>         chomp;
>         push hping_array, $_;
>         $hcount++;
> }
> print "@hping_array\n";
> 
> So the code is trying to run the hping3 command against $domain. I am awking
> for $5 which is the IPID value in the response. I am trying to push it into
> the array @hping_array. This should happen 5 times.
> 
> Then I'm printing @hping_array. I'm only getting one value and it is actually
> the whole response from hping. It seems to not respect the awk.

The system function does not return the output of the external command to
the callsign Perl program.

See perldoc -q "output of a command"
 "Why can't I get the output of a command with system()?


Navigate in group perl.beginners at sever nntp.perl.org
Previous Next


Your recent visits
Re: Web photo album, is this possible in CGI
Re: [PHP] php selecting multiple stylesheets
Re: Showing errors with user input
TFS and PB 11.2 performance issues
RE: [PHP-WIN] What about php 5.3 and printers or PHP_PRINTER.DLL ?


  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants