Suppose there is json file but some c style comments /* ... */ have been added to increase the readability like
{
"filename" : "alice " , /* name of the file */
/**
assume this case never happens "filename" : "alice /*bob*/"
**/
/***
some comments
*/
"files" : "/scratch/*" /* it should not remove "/scratch/*" */
}
How to write a script preferably bash or python that removes the comments from the json and return the correct json like
{
"filename":"alice ",
"files" : "/scratch/*"
}