Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • While zsh doesn't suck quite as much as bash for programming. This is still a task that would be better done in perl or python or some other language actually intended for programming. e.g. with the perl JSON module, just give it a string containing json text and it will return you a perl data structure containing all the scalar, array, and hash elements within the json document. You can access them as you would any other perl data structure - e.g. $j->{scary array}->[1] is A less scary value. I'll post a minimal example below. Commented Jul 6, 2022 at 9:41
  • @cas I fully agree with your sentiment and always use Python for more involved tasks, but I still prefer the convenience of Zsh for one-off things. Commented Jul 6, 2022 at 9:56
  • I get that, I really do. But if it's an f-ing PITA to work with, it's not really "convenience", is it? (btw, i write lots of little throwaway perl scripts for one-off things. I like the convenience :-). I guess I use perl for the things you use zsh scripting for). Commented Jul 6, 2022 at 10:06