Home  |  Linux  | Mysql  | PHP  | XML
From:Jim Gibson Date:Tue Feb  9 00: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: sequential value check
Re: Substitution question
sorting anonymous arrays inside arrays
Perl script to monitor memory usage on unix box
Re: Perl script to monitor memory usage on unix box



  
© No Copyright
You are free to use Anything, but please consult your advocate before doing so as this website
also list content from other sources which may be copyrighted.
Site Maintained by Zareef Ahmed
Powered By PHP Consultants