linux - replace null to ""test"" in a file using unix -


i have below pattern in file @ different lines

""key"": null 

i want replaceu

""key"": ""test"" 

through linux

i used below commands:

sed -i 's/ null / ""test"" /' sed -i 's/ null / \"\"test\"\" /' 

but failed.

this should it:

 sed -i 's/null/\"\"test\"\"/g' file.txt 

Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -