Skip to content

Instantly share code, notes, and snippets.

@ollyg
Created February 1, 2018 15:09
Show Gist options
  • Save ollyg/01b154b8782ba2375f26fb3c61962c4c to your computer and use it in GitHub Desktop.
Save ollyg/01b154b8782ba2375f26fb3c61962c4c to your computer and use it in GitHub Desktop.
perl one liners to fix snmpwalk output so it works with snmpsimulator
# 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