Forum Discussion
don_23889
Nimbostratus
Dec 28, 2009grep'ng for 'string' in bigip.conf
grep'ng for 'string' and returning entire block of object definitions from bigip.conf for each instance of 'string', starting with 'virtual' and ending with '}'
config less bigip.con...
Don_Munyak
Nimbostratus
Dec 30, 2009Posted By hwidjaja on 12/28/2009 10:26 AM
!/usr/bin/perl
use strict;
my ($File, $Pattern) = @ARGV;
my $buf;
open (fh, $File) || die "Cant open $File";
{
local $/;
$buf=;
}
close (fh);
while ($buf =~ /([^\n]*\{[^\{]*$Pattern[^\}]*\})/sg){
print "$1\n---\n";
}
Quick question...
For $buf=; ... is correct... or should it be (fh) ??
Thanks again
--Don
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
