Hacker News new | ask | show | jobs
by anamexis 1598 days ago
All fun and games until you need quoting. Quoting in shell scripts is already hellish enough, but layering JSON quoting on top of that is a road to madness.
1 comments

Combining here-string with `jq` (if you need variables), is plenty good enough. You'd need a single jq invocation.
Yes, `jq` would work fine, but so would `jo`. The point is, if there is anything more than the simplest dynamic values, constructing valid JSON just with POSIX shell is a huge pain.