On Tue, 25 Feb 2003, Jeff Lowrey wrote:

> At 10:12 AM +1100 2/26/03, John Horner wrote:
> >How do I find out if it's 10.1.3 or 10.1.5 from the command-line?
> >
>
> [toothgnip:~] jeff% osascript -e 'tell application "Finder" to version'
> osascript -e 'tell application "Finder" to version'
> 10.2.1

That looks painful. Why not just use one of these?

    % sw_vers
    ProductName:    Mac OS X
    ProductVersion: 10.2.4
    BuildVersion:   6I32

    % hostinfo
    Mach kernel version:
         Darwin Kernel Version 6.4:
    Wed Jan 29 18:50:42 PST 2003; root:xnu/xnu-344.26.obj~1/RELEASE_PPC


    Kernel configured for up to 2 processors.
    1 processor is physically available.
    Processor type: ppc750 (PowerPC 750)
    Processor active: 0
    Primary memory available: 320.00 megabytes.
    Default processor set: 91 tasks, 185 threads, 1 processors
    Load average: 1.06, Mach factor: 0.00

    % uname -a
    Darwin barney 6.4 Darwin Kernel Version 6.4: Wed Jan 29 18:50:42 PST 2003;
    root:xnu/xnu-344.26.obj~1/RELEASE_PPC  Power Macintosh powerpc

uname has the nice advantage of apparently existing on every version of
Unix I'm aware of (or at least, every one that I've tried), and it even
seems to support the same command line switches. (Doesn't give you your
OSX version number though -- sw_vers is the best for that.) Another good
more-or-less portable one is just "perl -V", which gives a lot of system
configuration data in addition to info about Perl itself. (But again, it
doesn't know what version of OSX...).




-- 
Chris Devers    [EMAIL PROTECTED]

optimizer, n.
A compiler with three switches for controlling its object code output:
big, slow, or both. Compare PESSIMIZING COMPILER.

    -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995

Reply via email to