On Tue, Mar 30, 2021, 4:53 PM Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> man bash does not mention json. So I assume bash does not support json
> natively?
>
> I see some discussion here on how to print associative arrays to json
> in bash. But the solution is not very nice.
>
>
>https://stackoverflow.com/questions/44792241/constructing-a-json-hash-from-a-bash-associative-array
>
> Is there a clean method to convert arbitrary bash data object (forget
> about function at this moment) to json?
>
> --
> Regards,
> Peng
>
What's not very nice about it? jq is the first tool I would reach for in
such a situation.
>