-2

i have a JSON file like following:

{
  "family": "amazon",
  "release": "2 (Karoo)",
  "runningKernel": {
    "release":"4.14.171-136.231.amzn2.x86_64",
    "version": ""
   },
  "packages": {
    "gcc": {
        "name": "gcc",
        "version": "7.3.1",
        "release": "6.amzn2.0.4",
        "arch": "x86_64"
    },
    "kernel": {
        "name": "kernel",
        "version": "4.14.173",
        "release": "137.229.amzn2",
        "arch": "x86_64"
    },
    "dmidecode": {
        "name": "dmidecode",
        "version": "3.0",
        "release": "5.amzn2.0.2",
        "arch": "x86_64"
    },
     "kernel": {
        "name": "kernel",
        "version": "4.14.171",
        "release": "136.231.amzn2",
        "arch": "x86_64"
    }
 }
}

As you can see, there are two kernel objects but I want to remove one other than the running kernel version, how can do that using CLI.

1 Answers1

0

I was unable to do it in Shell script, so i handled it in python.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 28 '22 at 16:22