Created
October 28, 2015 10:31
-
-
Save mrmrs/1783b78ebdb682a8edb1 to your computer and use it in GitHub Desktop.
Given the below json example - how would I replace the 7 characters with a different string after the hash for module2 from a unix command line?
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
{ | |
"module": "git+https://9gke37d40a7a9f84659e98f386d4ea2fda2a5d86:[email protected]/org-name/repo.git#71e84fd", | |
"module2": "git+https://9gke37d40a7a9f9999e98f386d4ea2fda2a5d86:[email protected]/org-name/repo.git#99h43ae", | |
"module3": "git+https://9gke37d40a7a9f33759e98f386d4ea2fda2a5d6:[email protected]/org-name/repo.git#94i53bb" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatively, you can specify an address regex for the substitution:
sed -e '/"module2"/ s/#.*$/__foo__",/g' /tmp/sed-regex-question.json