Created
August 1, 2021 06:35
-
-
Save Pigpog/6dffd42ffafd30445c710fbd7c50ea20 to your computer and use it in GitHub Desktop.
Shell script that performs the same task as the Cisco IOS command "section"
This file contains 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
#!/bin/sh | |
#usage: cat file | section PATTERN | |
grep "$1" -A9999 -m1 | grep '^[[:space:]]*$' -B9999 -A0 -m1 <&0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment