Comment 9 for bug 1405873

Revision history for this message
Jeff Silverman (jeffsilverm) wrote :

Still broken:

$ sudo lshw -json -C network | jq .
{
  "id": "network",
  "class": "network",
...
    "100bt-fd": "100Mbit/s (full duplex)",
    "1000bt-fd": "1Gbit/s (full duplex)",
    "autonegotiation": "Auto-negotiation"
  }
}
parse error: Expected value before ',' at line 48, column 4
$

Note that there is no leading [

$ sudo lshw -json -C network | head -5
                                                                                                                                              {
    "id"; : "network",
    "class"; : "network",
    "claimed" : true,
    "handle" : "PCI:0000:00:19.0",

But there is a comma at line 48. Why is jq failing there? Because there is no [. If I insert one, then the problem disappears.

$ sudo lshw -json -C network | head -52 | tail -6
    }
  },
                                                            {
    "id"; : "network",
    "class" : "network",
    "claimed" : true,

Note that there is no ] at the end of the file, which also causes jq to fail.

$ sudo lshw -json -C network | tail -6
    },
    "capabilities" : {
    "ethernet" : true,
    "physical" : "Physical interface"
    }
  }
$