here is my code
my @intf_list = ("xe-4/0/1", "xe-2/2/1"); foreach my $myint (@intf_list) { my @outputlist = split m([-/]), $myint; push (@fpc, $outputlist[1]); push (@pic, $outputlist[2]); push (@port, $outputlist[3]); print "my fpc of intf is $fpc[0]\n"; print "mu pic is $pic[0]\n"; print "my port is $port[0]\n";
Above execution results in my fpc of intf is 4 mu pic is 0 my port is 1 which is working fine as as per my expectation
Now, as per the following output. Adding the output in code section
show chassis fpc pic-status 4 Slot 4 Online MPC4E 3D 2CGE+8XGE PIC 0 Online 4x10GE SFPP PIC 1 Online 1X100GE CFP PIC 2 Online 4x10GE SFPP PIC 3 Online 1X100GE CFP
i want to find , how many PIC are there and there numbers say, PIC 0 , PIC 1 etc and find whether its online and also find whether it has only 10GE port. And compare, this PIC number with the above output $pic and do a decision. I tried the following code based on the output of the previous code section
$rh->cmd("show chassis fpc pic-status $fpc[0]"); my $output = $rh->get_response; my @outputlist = join s/(^\s+|\s+$)//g, $output;
I thought to elimate the space and combine all the test from the output, and then do a regexp to find the required parameters as mentioned above. But, i do not see any difference in the output, after the above code is executed. Is there a way to solve this?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |