delete entries with different termination and add a line to those entries
-
Hello,
I was wondering if someone could help me with a boring task I´m having. The idea is to delete an entry that repeats several times on a config file but with a different termination. Like so:
ip x.x.x.x
allow icmp
status off
snmp-index 12ip x.x.x.x allow icmp status off snmp-index 13
So would like to delete snmp-index X in all entries
and also add “status off” to all of them.Thank you!
-
Unfortunately, your post uses inconsistent indentation, and the forum interprets some, but not all, as putting it into a forum code box. Next time, make sure you paste your text exactly, then highlight all the pasted text in your post, then click the forum’s
</>
toolbar button, so that it all ends up in the same box with correct indentation.Your use of “termination” is too vague for me to be able to guess what you mean. And you don’t tell us how to know where “status off” should be added, or how to know what constitutes “an entry”
It would be really nice if you showed before and after data in separate text boxes (using the
</>
button), like,before
one block two blocks three blocks
after
1 block 2 blocks 3 blocks
If we were to try to guess what you intended, it’s likely to be wrong, thus wasting both our time and yours. Good luck.
----
Useful References