Created
April 6, 2021 20:55
-
-
Save RavuAlHemio/e219d84e23a20a426d75b11c131806aa to your computer and use it in GitHub Desktop.
awk script that does similar filtering to Cisco's "section" filter (show running-config | section ^interface Vlan)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^[^ ]/{printage = 0;} /PATTERN/{printage = 1;} { if (printage) { print $0; } } | |
Example: | |
awk '/^[^ ]/{printage = 0;} /^interface Vlan/{printage = 1;} { if (printage) { print $0; } }' configfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment