Created
February 1, 2018 15:09
-
-
Save ollyg/01b154b8782ba2375f26fb3c61962c4c to your computer and use it in GitHub Desktop.
perl one liners to fix snmpwalk output so it works with snmpsimulator
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
# stitch together STRINGs that are broken over multiple lines | |
perl -0777 -pe 's/\n(?!\.1\.3\.6)//g' | |
# put quotes around STRINGs where they are missing | |
perl -pe 's/= STRING: (?!")(.*)/= STRING: "\1"/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment