Last active
December 28, 2016 19:19
-
-
Save hperantunes/c2f2120e88464f085b949a6e73ea3891 to your computer and use it in GitHub Desktop.
Sanitizes some JSON response by replacing values
This file contains hidden or 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
echo '{"somePassword": "password", "someSecret": "secret", "somethingElse": unchanged"}' \ | |
| sed '/\(Password": *"\|Secret": *"\)[^"]*\("\)/ s//\1*****\2/g' | |
# {"somePassword": "*****", "someSecret": "*****", "somethingElse": unchanged"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment