[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Print bash data structure to json
From: |
Dennis Williamson |
Subject: |
Re: Print bash data structure to json |
Date: |
Tue, 30 Mar 2021 18:53:41 -0500 |
On Tue, Mar 30, 2021, 6:35 PM Peng Yu <pengyu.ut@gmail.com> wrote:
> 1. Calling an external command.
> 2. Have to reformat a bash object in a way that jq accepts.
>
>
Skip Bash (and jq) and use Python and its JSON module.
Or use Bash and a lot of code to massage Bash data into JSON.
Or write a loadable builtin that duplicates jq.
I would choose Bash and jq or Python and JSON depending on my need. I would
put a bunch of other choices ahead of the pure Bash or loadable builtin.
But that's just me.