I have a file like this -
! interface csa2549abA xxxx yyyy zzzz ! interface aso23apwoeAe aaa bbb ccc ! interface FastEthernet0/1 ppp qqq rrr !
and so on.
What I want is to rename the
interfaces that look like hashes to something more coherent but not the ones that makes sense and make the output like this. The key difference between ones that makes sense and the ones that don't is that the ones that are hashes have numbers in between the name. The ones that make sense always end with numbers. The output should look like this -
! interface ethernet1 xxxx yyyy zzzz ! interface ethernet2 aaa bbb ccc ! interface FastEthernet0/1 ppp qqq rrr !
and so on. Each interface is just an increment on the values of the
Also assume that there are multiple files each of this type which can be taken as input.
What I have right now is
sed -i 's/^interface .*$/interface Ethernet/' * but this just replaces the values of every interface value with Ethernet. I was wondering if there was a command to just increment the last part of
Ethernet to represent something like I want.