Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Perl on OSX > Re: Detecting O...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 16 Topic 999 of 1076
Post > Topic >>

Re: Detecting OS X version from perl

by cdevers@[EMAIL PROTECTED] (Chris Devers) Nov 17, 2007 at 09:46 PM

On Nov 17, 2007, at 7:37 PM, Michael Barto wrote:

> Just a quick question. Is there a command line at a terminal window  
> of MacOSX that can do this- tell you more about the hardware?

Quick re****t:

     $ system_profiler -detailLevel mini

Obsessive detail re****t:

     $ system_profiler -detailLevel full

> Also list software packages and their revisions and also patches?

You can get a lot of this from skimming through the /Library/Receipts  
folder, e.g.:

     $ grep -A1 'BundleShortVersion' /Library/Receipts/*.pkg/Contents/ 
version.plist  | grep string

This works better up through Tiger; the package format changed with  
Leopard and there may be a new, better way to access that now (maybe  
run `lsbom` on files under /Library/Receipts, but that doesn't seem to  
have version data).

You can also just query the app directly, modifying the example above,  
as:

     $ grep -A1 'BundleShortVersion' /Applications/*.app/Contents/ 
version.plist  | grep string

Which now that I think about it probably the way to go, as it's  
largely the same data as the Receipts folder, but also includes things  
that don't have an installer (e.g. Firefox, Skype, Adium) and things  
with a third-party installer (Microsoft Office, the Adobe CS suite,  
StuffIt, etc).

  * * * * *

On a different tack, since this thread has come back up, I forget if  
it was mentioned the first time around, but the system version and  
build should always be available from:

     $ cat /System/Library/CoreServices/SystemVersion.plist

This is useful if you ever need to check, say, a remote file server,  
or a machine in Firewire target mode, where you can't query  
system_profiler, sw_vers, etc.

If you do the same for the Finder --

     $ cat /System/Library/CoreServices/Finder.app/Contents/ 
version.plist

-- it may or may not be in step with the SystemVersion (it probably  
would be, but checking the system itself is more direct).


-- 
Chris Devers
 




 16 Posts in Topic:
Detecting OS X version from perl
david@[EMAIL PROTECTED]   2007-10-14 17:29:25 
Re: Detecting OS X version from perl
emoy@[EMAIL PROTECTED] (  2007-10-14 10:45:30 
Re: Detecting OS X version from perl
david@[EMAIL PROTECTED]   2007-10-14 23:56:52 
Re: Detecting OS X version from perl
cdevers@[EMAIL PROTECTED]  2007-10-14 21:37:11 
Re: Detecting OS X version from perl
JD@[EMAIL PROTECTED] (Jo  2007-10-14 19:25:12 
Re: Detecting OS X version from perl
pudge@[EMAIL PROTECTED]   2007-10-15 17:52:04 
Re: Detecting OS X version from perl
nospam@[EMAIL PROTECTED]   2007-11-17 13:21:45 
Re: Detecting OS X version from perl
mbarto@[EMAIL PROTECTED]   2007-11-17 16:37:06 
Re: Detecting OS X version from perl
lprall@[EMAIL PROTECTED]   2007-11-17 21:36:41 
Re: Detecting OS X version from perl
cdevers@[EMAIL PROTECTED]  2007-11-17 21:46:17 
Re: Detecting OS X version from perl
kurtzlepirate@[EMAIL PROT  2007-11-18 10:49:22 
Re: Detecting OS X version from perl
mbarto@[EMAIL PROTECTED]   2007-11-18 17:40:51 
Re: Detecting OS X version from perl
brian.d.foy@[EMAIL PROTEC  2007-11-19 20:22:32 
Re: Detecting OS X version from perl
peter@[EMAIL PROTECTED]   2007-11-18 17:02:02 
Re: Detecting OS X version from perl
brian.d.foy@[EMAIL PROTEC  2007-11-18 21:22:04 
Re: Detecting OS X version from perl
cdevers@[EMAIL PROTECTED]  2007-11-20 22:21:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 0:54:05 CST 2008.