#!/usr/bin/perl use strict; while (my $line = <DATA>) { print $line; if ( $line =~ /\sip address/ ) { $line =~ s/(\d+.\d+.\d+.)252/${1}100/; print $line; } } __DATA__ ip vrf forwarding ABC:Defgh ip address 1.1.1.1 255.255.255.252 ip vrf forwarding ABD: Efghi ip address 2.2.2.2 255.255.255.252
In reply to Re: How to duplicate lines
by bichonfrise74
in thread How to duplicate lines
by ddrew78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |