12-10-2008
This works ... but it just seems that there is a better way ..
if ($_ =~ /\s\b[5-9]\./) {
@ip = split(/ /,$_);
push(@dos, $ip[4])};
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
another perl question,
I don't understand the below
while (<FILE>) {
push @last5, $_; #add to the end
shift @last5 if @last5 > 5 ; #take from the beginning
}
can someone please explain to me how does
shift @last5 if @last5 > 5 is taking last 5 lines from... (5 Replies)
Discussion started by: hankooknara
5 Replies
2. Shell Programming and Scripting
$key = "a";
$value = "hello";
%myhash = {} ;
push @{ myHash{$key} }, $hello;
print $myHash{$key}."\n";
this script prints
"hello" but has following error message.
Reference found where even-sized list expected at ./test line 5.
can any one help me to fix this problem?? (3 Replies)
Discussion started by: bonosungho
3 Replies
3. Shell Programming and Scripting
NEWBIE ALERT!
Hi,
I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
Discussion started by: jospan
0 Replies
4. Shell Programming and Scripting
Hi Everyone,
Any simple code can simplify the code below, please advice. Thanks
# cat 2.pl
#!/usr/bin/perl
use warnings;
use strict;
my @aaaaa = <DATA>;
my @uids;
foreach (@aaaaa) {
my @ccccc = split (",", $_);
push @uids, $ccccc;... (3 Replies)
Discussion started by: jimmy_y
3 Replies
5. Shell Programming and Scripting
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Discussion started by: jimmy_y
0 Replies
6. Shell Programming and Scripting
Hi Everyone,
($total+=$_) for @record;
assume @record=(1,2,3), so the result is 6.
if @record=("1 3","2 3","3 3"), would like to sum up the 2nd field of this array, the result is 9.
i tried " ($total+=$) for @record ", cannot, please advice.
Thanks
---------- Post updated at 03:45... (1 Reply)
Discussion started by: jimmy_y
1 Replies
7. Shell Programming and Scripting
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Discussion started by: chidori
11 Replies
8. Programming
I have a code snippet here that is supposed to vary values of certain parameter values:
<script type="text/javascript">
// dynamic array of which its ultimate size is unknown
// an array of arrays, each consisting of one variation
var variations = ;
// parameters of how to create a... (0 Replies)
Discussion started by: figaro
0 Replies
9. Shell Programming and Scripting
In the awk below I am trying to print only the header lines starting with # or ## and the lines that $7 is PASS and AF= is less than 5%. The awk does execute but returns an empty file and I am not sure what I am doing wrong. Thank you.
file
... (0 Replies)
Discussion started by: cmccabe
0 Replies
10. Shell Programming and Scripting
I am trying to use awk to print lines that satisfy either of the two conditions below:
condition 1: $2 equals CNV and the split of $3, the value in red, is greater than or equal to 4. ---- this is a or so I think
condition 2: $2 equals CNV and the split of $3, the value in red --- this is a... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT CENTOS
aggregate-ios
AGGREGATE-IOS(1) General Commands Manual AGGREGATE-IOS(1)
NAME
aggregate-ios - optimise a concatenated set of cisco/IOS prefix filters to help make them nice and short.
SYNOPSIS
aggregate-ios <source_config >optimised_config
DESCRIPTION
Takes cisco IOS configuration on stdin, and optimises any prefix filters found using aggregate(1). Optimised filters are produced on std-
out.
OPTIONS
None.
DIAGNOSTICS
Any diagnostics produced by aggregate(1) are passed through on stderr.
EXAMPLES
The following configuration fragment:
ip prefix-list AS65530 description Foo, Inc
ip prefix-list AS65530 permit 10.1.0.0/16
ip prefix-list AS65530 permit 10.2.0.0/16
ip prefix-list AS65530 permit 10.2.1.0/24
ip prefix-list AS65530 permit 10.3.0.0/16
ip prefix-list AS65531 description Bar.Com
ip prefix-list AS65531 seq 5 permit 192.168.1.0/24
ip prefix-list AS65531 seq 10 permit 192.168.2.0/24
ip prefix-list AS65531 seq 15 permit 192.168.0.0/19
is optimised as follows:
ip prefix-list AS65530 permit 10.1.0.0/16 le 24
ip prefix-list AS65530 permit 10.2.0.0/15 le 24
ip prefix-list AS65531 permit 192.168.0.0/19 le 24
SEE ALSO
aggregate(1)
HISTORY
Aggregate-ios was written by Joe Abley <jabley@mfnx.net>.
BUGS
All those in aggregate(1) and then some :)
Joe Abley 2000 November 27 AGGREGATE-IOS(1)