So I have a bash script which outputs details on servers. The problem is that I need the output to be JSON. What is the best way to go about this?
bash
JSON
I wrote a tiny program in Go, json_encode. It works pretty good for such cases:
$ ./getDistro.sh | json_encode ["my.dev","Ubuntu 17.10","4 days, 2 hours, 21 minutes, 17 seconds"]