Skip to content

Instantly share code, notes, and snippets.

@Pigpog
Created August 1, 2021 06:35
Show Gist options
  • Save Pigpog/6dffd42ffafd30445c710fbd7c50ea20 to your computer and use it in GitHub Desktop.
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"
#!/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