Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Reboots | 21 comments | Create New Account
Click here to return to the 'Reboots' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Reboots
Authored by: sweth on Sep 15, '07 01:50:56PM
As long as you don't care about the PCI version numbers and the like, you can just use
system_profiler SPUSBDataType | perl -ne '/^s{8}w/ && print' | sort
and you should get a list of attached devices that stays stable across reboots (assuming Apple doesn't change the formatting of the output of system_profiler in a new revision).

[ Reply to This | # ]
Reboots
Authored by: lincd0 on Sep 15, '07 02:28:00PM

I thought of doing something like that, but with sed instead of perl. What I'd really like, though, is to take the output of system_profiler as a plist (with the -xml option) and parse that to create a searchable database of known USB devices. Then you could add and remove those devices without raising a false alarm. You can read the plist output with defaults.

[ Reply to This | # ]