Re: Is this legit? [POSIX]
Re: Is this legit? [POSIX]
- Subject: Re: Is this legit? [POSIX]
- From: "Nigel Garvey" <email@hidden>
- Date: Fri, 25 Jul 2008 22:42:31 +0100
"Mark J. Reed" wrote on Fri, 25 Jul 2008 09:19:54 -0400:
>> -- "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/(.*)} )' "
Yes it is. Just. Thanks, Mark. :)
NG
_______________________________________________
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