• 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: Is this legit? [POSIX]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this legit? [POSIX]


  • Subject: Re: Is this legit? [POSIX]
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 25 Jul 2008 09:19:54 -0400

On Fri, Jul 25, 2008 at 8:56 AM, Nigel Garvey
<email@hidden> wrote:
>
>  -- "perl". (Faster than "ls"):
>  set tz to (do shell script "perl -le 'print readlink(\"/etc/
> localtime\")' | cut -d / -f 5-")
>  -- Or, faster:
>  set tzPath to (do shell script "perl -le 'print readlink(\"/etc/
> localtime\")'")
>  set astid to AppleScript's text item delimiters
>  set AppleScript's text item delimiters to "zoneinfo/"
>  set tz to text item 2 of tzPath
>  set AppleScript's text item delimiters to astid
>  tz

Interesting.   Wonder if it would be faster to do all the parsing in Perl:

do shell script "perl -le 'print( readlink(\"/etc/localtime\") =~
m{zoneinfo/(.*)} )' "

--
Mark J. Reed <email@hidden>
 _______________________________________________
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

References: 
 >Re: Is this legit? [POSIX] (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: Is this legit? [POSIX]
  • Next by Date: Computer Serial Number
  • Previous by thread: Re: Is this legit? [POSIX]
  • Next by thread: Re: Is this legit? [POSIX]
  • Index(es):
    • Date
    • Thread