• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Comparing version strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing version strings


  • Subject: Re: Comparing version strings
  • From: Luther Fuller <email@hidden>
  • Date: Thu, 11 Dec 2008 08:18:47 -0600

On Dec 11, 2008, at 8:05 AM, SVV Satyanarayana wrote:

The following command give the version of mono:
do shell script "/usr/bin/mono -V | awk '/version/ {print $5}'"

I am getting the output as "1.2.5"
Now I want to compare the mono version whether it is greater than or equal to 1.2.5 using script.
How to check it through Apple Script.

Here's what I use ...

set AppleScript's text item delimiters to {"."}
(text items of (system version of (system info)) & {"0", "0", "0"})
1000000 * (item 1 of the result) + 1000 * (item 2 of the result) + (item 3 of the result)
if the result < 10005000 then
-- do stuff for Tiger only
end if


You could use your 'do shell script ...' in place of my '(system version of (system info))'.
Hope this helps.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden
  • Follow-Ups:
    • Re: Comparing version strings
      • From: Christopher Nebel <email@hidden>
References: 
 >Finder folder names (From: Luther Fuller <email@hidden>)
 >Re: Finder folder names (From: Luther Fuller <email@hidden>)
 >Re: Finder folder names (From: Tim Mansour <email@hidden>)
 >Re: Finder folder names (From: Luther Fuller <email@hidden>)
 >Dock folder menus (From: Luther Fuller <email@hidden>)
 >Comparing version strings (From: SVV Satyanarayana <email@hidden>)

  • Prev by Date: Comparing version strings
  • Next by Date: Code Signing
  • Previous by thread: Comparing version strings
  • Next by thread: Re: Comparing version strings
  • Index(es):
    • Date
    • Thread