mib2c.extract.pl
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:1k
- #!/usr/bin/perl
- # read comments from mib2c and insert them in mib2c.conf.5
- my $mib2csrc = shift;
- while (<>) {
- if (/COMMANDSHERE/) {
- open(I,$mib2csrc);
- while (<I>) {
- last if (/^# which include:/);
- }
- while (<I>) {
- last if (!/^#/);
- s/^#s+//;
- s/^(@.*@)$/.IP "$1"/;
- print;
- }
- close(I);
- } elsif (/VAREXPANSIONSHERE/) {
- open(I,$mib2csrc);
- while (<I>) {
- last if (/^# Mib components,/);
- }
- while (<I>) {
- last if (!/^#/);
- next if (/^#s*$/);
- s/^#s+//;
- s/^(S+)s+--s+(.*)/.IP "$1"n$2/;
- print;
- }
- close(I);
- } else {
- print;
- }
- }