I have the following json file :
{
"src": "ssh://git@bitbucket.org/myrepos/project",
"version": "master",
"archetype_version": "master",
"roles": [
{
"src": "ssh://git@bitbucket.org/myrepos/project",
"version": "master"
}
]
}
I want to change the version from master to another one, so I do the following command:
cat file.json | jq '.roles[0].version = "new"' | jq '.version = "new"' | jq '.archetype_version = "new"' > file2.json
How to save the changes to file.json
not to file2.json
because I'll need to use the same file later?