News for hackers. Stuff that matters.
Re:Jo – a shell command to create JSON (2016) by bb88 on Sunday February 06, 2022 @05:33AM (#30231210)
I'm not disagreeing that python is slow, but why would you choose to do either in a shell script?

    $ time cat<<EOL
    {"name": "JP", "object": {"fruit": "Orange", "point": {"x": 10, "y": 20}, "number": 17}, 
    "sunday": false}  
    EOL
    {"name": "JP", "object": {"fruit": "Orange", "point": {"x": 10, "y": 20}, "number": 17}, 
    "sunday": false}

    real 0m0.002s
    user 0m0.000s
    sys  0m0.002s
Re:Jo – a shell command to create JSON (2016) by zimpenfish on Sunday February 06, 2022 @06:10AM (#30231414)
> why would you choose to do either in a shell script?

In the normal case, you'd have variables interpolated in there, not static JSON. And then you run into the quoting problems that jo was created to work around...