I have file content like this:
aaa accounting exec ...
aaa accounting exec ...
aaa accounting commands ..
aaa accounting commands ..
aaa accounting commands ..
aaa accounting commands ..
aaa accounting commands ..
aaa accounting commands ..
aaa accounting network ..
aaa accounting connection ..
aaa accounting system ..
!
aaa accounting exec default
action-type start-only
group tacacs+
!
aaa accounting exec default stop-only group tacacs+
The output should be like this:
aaa accounting exec default ..
aaa accounting exec default
action-type start-only
group tacacs+
!
aaa accounting exec default ..
I have tried following sed
command:
sed -n '/aaa accounting exec default/,/!/p' AboveFileContent.txt
But it's not produce what I want.
What would be the solution? I have tried using awk
also but same result is coming. What would be the command to get the exact output?
aaa accounting exec default ..
points to what line(s) in your input file??