Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: plist output (was: Rescan for ahcisata ?)



On Mon, Jan 16, 2012 at 02:31:05PM -0500, Matthew Mondor wrote:
> On Mon, 16 Jan 2012 12:34:02 -0600
> David Young <dyoung%pobox.com@localhost> wrote:
> 
> > On Mon, Jan 16, 2012 at 06:45:34AM -0800, Paul Goyette wrote:
> > > # drvctl -p atabus0 interface-attributes
> > > Array:
> > 
> > If printing 'Array:' is intentional, be sure to suppress it when the
> > flag -n is given.  (Looks like I didn't update the manual page, oops.)
> > 
> > I think that filtering the propery list by keys should be left to some
> > other tool, e.g., one of the xmltools.  In the xmlgrep syntax, the
> > command would be:
> > 
> >        drvctl -p atabus0 | xmlgrep '//interface-attributes'
> > 
> > BTW, I am looking for a volunteer to work on xmltools.  Anyone?
> 
> I was precisely about to ask if it'd be desirable to have a command to
> simply load a plist it's fed and output it in a human readable form:
> 
> behemoth# drvctl -pn wd0
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
> <plist version="1.0">
> <dict>
>         <key>device-driver</key>
>         <string>wd</string>
>         <key>device-unit</key>
>         <integer>0x0</integer>
>         <key>disk-info</key>
>         <dict>
>                 <key>geometry</key>
>                 <dict>
>                         <key>cylinders-per-unit</key>
>                         <integer>0x97695</integer>
>                         <key>sector-size</key>
>                         <integer>0x200</integer>
>                         <key>sectors-per-track</key>
>                         <integer>0x3f</integer>
>                         <key>sectors-per-unit</key>
>                         <integer>0x2542eab0</integer>
>                         <key>tracks-per-cylinder</key>
>                         <integer>0x10</integer>
>                 </dict>
>                 <key>type</key>
>                 <string>ESDI</string>
>         </dict>
> </dict>
> </plist>
> 
> behemoth# drvctl -pn wd0 | plist-humanize
> device-driver = wd
> device-unit = 0
> disk-info = 
>  geometry =
>    cylenders-per-unit = 620181
>    sector-size = 512
>    sectors-per-track = 63
>    sectors-per-unit = 625142448
>    tracks-per-cylender = 16
>  type = ESDI

This is a pretty good job for xmlsed. :-)

Dave

-- 
David Young
dyoung%pobox.com@localhost    Urbana, IL    (217) 721-9981


Home | Main Index | Thread Index | Old Index