Skip to content

Instantly share code, notes, and snippets.

@santrancisco
Created January 31, 2019 02:14
Show Gist options
  • Save santrancisco/e6db181e35c50068a8fa78a2177a9aab to your computer and use it in GitHub Desktop.
Save santrancisco/e6db181e35c50068a8fa78a2177a9aab to your computer and use it in GitHub Desktop.
bash tricks - to be updated

gnu sed

masking out key,token,secret when reading a file to stdout - could be used as an alias to used for demo/presenting.

gsed -r -e "s/((key|token|secret)[^(:|=)]*(=|:)[\t| ]+?['|\"]?+)[^('|\"|$)]*('|\"|$)/\1xxxxxxxxxxx\4/g" ~/.aws/credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment