<div dir="ltr"><div><div><div>I&#39;ve attached a potentially useful script; it also appears in tab-mangled form below; it&#39;s designed to identify time zones that are the same in the long run.<br><br></div>Given the name of a zone.tab file and the name of a time-zone-binary directory, the script runs through the zones mentioned in zone.tab and finds the associated POSIX string that applies after the last transition time specified in the zone&#39;s binary file. Each line of output begins with a POSIX string, followed by the name of each zone to which that string applies; output is sorted by POSIX string. So:<br>
<br>    AFT-4:30    Asia/Kabul<br>    AKST9AKDT,M3.2.0,M11.1.0    America/Anchorage America/Juneau America/Sitka America/Yakutat America/Nome<br>    ...<br><br></div>There&#39;s surely room for improvement.<br><br></div>        @dashdashado<br>
<br>#!/bin/perl<br><br>my $O = $0;<br><br>$O =~ s@.*[\/\\]@@;<br>$O =~ s@.pl$@@i;<br><br>if ($#ARGV != 1) {<br>    printf STDERR &quot;$O: usage is $O zone.tab tz-binary-directory\n&quot;;<br>    exit(1);<br>}<br><br>my ($zonetab, $tzdir) = @ARGV;<br>
<br>open(S, &quot;&lt;$zonetab&quot;) || die(&quot;cannot open $zonetab&quot;);<br>while(&lt;S&gt;) {<br>    s@[\r\n]@@g;<br>    s@\s*#.*@@;<br>    $zone = (split())[2];<br>    $zone eq &quot;&quot; &amp;&amp; next;<br>    $binary = &quot;$tzdir/$zone&quot;;<br>
    open(T, &quot;&lt;$binary&quot;) || die(&quot;cannot open $binary&quot;);<br>    $posix = ();<br>    while (&lt;T&gt;) {<br>        $posix = $_;<br>    }<br>    close(T);<br>    $posix =~ s@[\r\n]@@g;<br>    if ($posix eq &quot;&quot;) {<br>
        $posix = $zone;<br>    }<br>    $result = $results{$posix};<br>    if ($result ne &quot;&quot;) {<br>        $result .= &quot; &quot;;<br>    }<br>    $result .= $zone;<br>    $results{$posix} = $result;<br>}<br>close(S);<br>
<br>foreach (sort keys %results) {<br>    print &quot;$_\t$results{$_}\n&quot;;<br>}<br><br><br>exit(0);<br><br><br></div>