Hi,
I'm new to this forum, and searched through the previous posts, but didn't see anything close enough to what i'm looking for.
I have a radius file like this:
testone Password = "11111"
Service-Type = "Framed-User",
Session-Timeout = "9000",
Ascend-Idle-Limit = "900"
testtwo Password = "11111"
Service-Type = "Framed-User",
Session-Timeout = "9000",
Ascend-Idle-Limit = "900"
testthree Password = "11111"
Framed-Address = "000.000.000.000",
Framed-Netmask = "255.255.255.0"
Ascend-Route-IP=Route-IP-Yes
Framed-Route = "000.000.000.000/29 000.000.000.000 1 n"
1testone Password = "11111"
Service-Type = "Framed-User",
Ascend-Idle-Limit = "900"
testtwo5 Password = "11111"
Service-Type = "Framed-User",
Session-Timeout = "9000",
Ascend-Idle-Limit = "900"
###EOF###
I need to search for an exact match of the username such as testtwo and delete that line and all the lines below it until I reach the next username.
The main problem is there is no set number of lines below the username, it could be anywhere from 2-8 lines.
The only constants are:
The username will allways be at the beginning of a new line and the word password will always and only be on the same line as the username.
I'm on a linux server, so any combination of sed, awk or perl should work.
Thanks in advance for any help.