Skip to content

Instantly share code, notes, and snippets.

@gerep
Last active February 25, 2016 20:49
Show Gist options
  • Save gerep/d089d26c84dec3100c47 to your computer and use it in GitHub Desktop.
Save gerep/d089d26c84dec3100c47 to your computer and use it in GitHub Desktop.
This sed command will search for the tab <KEY>. count 12 characters and replace them with *. The same happens with the tag <KEYVAL>
sed -e 's/<KEY>[0-9]\{12\}/(&)/g' -e 's/(<KEY>.*)/<KEY>*************/g' -i blah.log
sed -e 's/<KEYVAL>[0-9]\{12\}/(&)/g' -e 's/(<KEYVAL>.*)/<KEYVAL>*************/g' -i blah.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment