Skip to content

Instantly share code, notes, and snippets.

@raspi
Created March 27, 2021 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raspi/d7db0967608623444a6e6cfa49a25775 to your computer and use it in GitHub Desktop.
Save raspi/d7db0967608623444a6e6cfa49a25775 to your computer and use it in GitHub Desktop.
Censor MAC address, IPv4 address from some output
# mac:
echo "..." | perl -pe 's@[\da-f:]{17}@xx:xx:xx:xx:xx:xx@ig'
# IPv4
echo "..." | perl -pe 's@[\d\.]{7,15}@X.X.X.X@ig'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment