[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Light weight support for JSON
From: |
Dennis Williamson |
Subject: |
Re: Light weight support for JSON |
Date: |
Sun, 28 Aug 2022 21:03:44 -0500 |
On Sun, Aug 28, 2022 at 7:47 PM Dale R. Worley <worley@alum.mit.edu> wrote:
> The "obvious" way to support Json in Bash would be a utility that parses
> Json and produces e.g. a Bash associative array, and conversely a
> utility that reads a Bash associative array and produces Json. The real
> limitation is that it's difficult to have a subprocess set Bash's
> variables. As far as I know, there's no good idiom for that.
>
> Dale
>
>
If your json_util outputs a Bash declare -A statement then you could just
eval it to get your associative array.
The utility would need to guarantee against code injection in its output.
Another issue is that JSON can express things that Bash associative arrays
can't and so then you get into a rat's nest of workarounds.
--
Visit serverfault.com to get your system administration questions answered.
- Re: Light weight support for JSON, (continued)
Re: Light weight support for JSON, Lawrence Velázquez, 2022/08/28
Re: Light weight support for JSON, Dale R. Worley, 2022/08/28
Re: Light weight support for JSON, Chet Ramey, 2022/08/29
Re: Light weight support for JSON, Chet Ramey, 2022/08/29
Re: Light weight support for JSON, John Passaro, 2022/08/28