Re: Is this legit? [POSIX]
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