Below is extract from the file to be changed: May use awk or sed...any utility is good for pattern matching
mgad 1
m-id 50
rf-chan-id 1
base-station-id 00:a0:bc:0c:1b:c1
....
....
mgad 2
....
base-station-id 00:a0:bc:0c:1b:c2
....
....
mgad 3
....
base-station-id 00:a0:bc:0c:1b:c3
....
....
mgad 4
base-station-id 00:a0:bc:0c:1b:c4
I have to edit mac address in the 5th position from 00:a0:bc:0c:XX:c3 to 00:a0:bc:0c:18:c3 for multiple lines in the file. PN: 5th position can be variable,needs to be changed to "18"
I tried this:
sed -En ' s/^\( base-station-id.* [0-9A-Fa-f]{2}\:[0-9A-Fa-f]\:[0-9A-Fa-f]\:[0-9A-Fa-f]\:\)[0-9A-Fa-f]+\(\:.*\)$/\118\2/p; '
Please help with correct regex pattern matching and replace with desired change in substring in mac address