Soak up input before writing a file
medium risk
From moreutils: lets you modify a file in a pipeline.
jq '.x=1' f.json | sponge f.jsonSafe in-place edit · explain & risk-check →Reference text is hand-written and may be incomplete — check man sponge for your version. Test destructive commands on a non-production system first.