0

I am looking to read a JSON file using shell script and getting Id based on the name attribute and store it in a variable without using "jq". Please suggest how it can be done. The json looks like:

{
          "elements": [
            {
              "id": "1",
              "internalId": "AA",
              "name": "SampleService",
            },
            {
              "id": "2",
              "internalId": "BB",
              "name": "Loan_Evaluation",
            },
            {
              "id": "3",
              "internalId": "CC",
              "name": "Miniloan Service",
            }
          ],`
     }
James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    Why do you want to not use jq? Is it because the input JSON is not well-formed? – glenn jackman Jul 12 '21 at 18:25
  • [Here's good info](https://stackoverflow.com/a/1955555/2834978) and several answers. Also, take some time to read [how to ask on SO](https://stackoverflow.com/help/mcve) – LMC Jul 12 '21 at 20:04
  • _"using shell script"_ means you want to parse JSON with just native Bash tools? Good luck with that. – Reino Jul 18 '21 at 11:18

0 Answers0