LinuxSay - A Discussion Forum for Linux Enthusiasts

How to replace json parameter dynamically


I need to change the “version” value at run time. How it can be done via shell script? as per below json, I need to replace “20181018” with “20181234”. No more change OR extra space should come.

“app”: “Deploy”,
“env”: “UAT”,
“versions”: [
“version”: “20181018”,


In above query, that new parameter would be supplied via an argument which would be passed along with the shell.
For an instance, If is the script, Then I would be executing it as

./ 20181234

So, should change the value “20181018” with $1 in json file.
Hope, it clarifies the requirement