Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to get OS version with Shell script?




Le 11 janv. 07 à 16:11:17, Horky Chen a écrit :

Dear all,

Now, I want to write a script to check current version of Mac OS. How to do?


Hello

Most of the time I use this handler:

 =====

on quelOS()
try
(* «event fndrgstl» = forme canonique de system attribute *)
-- set hexData to «event fndrgstl» "sysv"
set {hexData, hexString} to {system attribute "sysv", {}}
repeat 4 times
set hexString to ((hexData mod 16) as string) & hexString
set hexData to hexData div 16
end repeat
set OS_version to hexString as string
on error
set OS_version to "0000"
(* retournera "0000" si "system attribute" n'est pas reconnu *)
end try
return OS_version
end quelOS

Yvan KOENIG

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden

References: 
 >how to get OS version with Shell script? (From: "Horky Chen" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.