1
我需要在Mac OS X中获得ioreg
的输出作进一步处理,但是它使用的树状结构难以解析?有什么办法可以用XML获取输出或者更容易解析(如system_profiler
)?是否有可能以更容易解析的格式获取ioreg的输出?
+-o Root <class IORegistryEntry, retain 12>
| {
| ...
| }
|
+-o MacBookPro5,1 <class IOPlatformExpertDevice, registered, matched, active, busy 0, retain 25>
| {
| ...
| }
|
+-o AppleACPIPlatformExpert <class AppleACPIPlatformExpert, registered, matched, active, busy 0, retain 51>
| | {
| | ...