79260456

Date: 2024-12-07 10:53:41
Score: 1
Natty:
Report link

One more workaround:

RES=$(jq '.test = "test_val"' sample.json) && echo -e "$RES" > sample.json
  1. Save result of jq usage to variable,
  2. If (1) was successfull - echo variable, keeping linebreaks,
  3. Write terminal output to original file.
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Dmitry Petrouk