[conspire] "Time zones exist to make programmers' lives miserable" ...

Rick Moen rick at linuxmafia.com
Sun Feb 7 00:33:09 PST 2021


Quoting Michael Paoli (Michael.Paoli at cal.berkeley.edu):

[snippety-snip]

> Oh, and how many timezone names and variations currently?
> $ find /usr/share/zoneinfo/*/ -follow -type f -print | wc -l
> 1779
> $

Yes, _but_ that includes these three files that are not actually timezones:
/usr/share/zoneinfo/iso3166.tab
/usr/share/zoneinfo/zone.tab
/usr/share/zoneinfo/posixrules 

And _that_ is why my tzall shell function greps them out.  ;->

> And ... how many actually with unique timezone data?
> $ find /usr/share/zoneinfo/*/ -follow -type f -exec sha512sum \{\}
> \; | awk '{print $1;}' | sort -u | wc -l
> 774
> $

Well, yes, those are the ones that have unique bitwise contents, _but_
the multiple names to some of them are nonetheless each (separately)
semantically meaningful, for sundry reasons.

> $ echo $(find /usr/share/zoneinfo/*/ -follow -type f -exec sha512sum
> \{\} \; | fgrep 01e5216822bc00070c7728249ed4443b070f901f6337de4ee72b7f4b6623b2638be69f72e5eb0838ad3c78e70618f1c839e681928316305f9b0ab9922c039f51
> | sed -e 's/^[^ ]*  *\/usr\/share\/zoneinfo\///' | sort) | fold -s
> -w 72

You know you can do specify a non '/' delimiter to sed, right?  And
avoid the picket-fence ugliness?  That's what I do when having to
process pathspecs using sed.  I really hate having to backslash-escape
my forward slashes:  Legibility goes down through the floor.

Just put your prefered delimiter after the 's instead of the / 

(I tend to use _ in such cases.)





More information about the conspire mailing list