Forum Discussion
Grep command help to search and print the lines between the matches
Hello All,
I'm working to get the complete configuration of VIP from the "/" using recursive search. Below command is working to get the configuration of a VIP and it print 75 lines after the search by this way configuration of an other VIP is also getting printed.
show running-config ltm recursive virtual all-properties | grep "VIP_NAME" -A 75
Can u help to further tune the search with start string of "VIP NAME" and print the lines and it should stop if there is a match for the string "vs-index"
Regards,
Thiyagu
2 Replies
- What_Lies_Bene1
Cirrostratus
I'd use sed instead:
... | sed -n '/VIP_NAME/,/vs-index/p'
- Dario_Garrido
Noctilucent
You have to run the same command from outside of TMSH shell (I mean Bash shell).
tmsh -q -c "cd / ; show running-config ltm recursive virtual all-properties" | awk '/VIP_NAME/,/vs-index/'
KR,
Dario.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com