#!/bin/sh # tzposixrules.sh - extract POSIX rule at end of zoneinfo files zid=/usr/share/zoneinfo/ # zoneinfo directory path for zif in $( find $zid -type f # files only ) do # dump all text strings with leading file path -f strings -f $zif | \ sed " \$!d # delete all but last line - escape '$' /\/posix\//d # delete .../posix/... paths /\/right\//d # delete .../right/... paths /[^.]\+\.[^:]\+:/d # delete *?.?* files s|^$zid|| # strip leading zoneinfo directory path # s|:\s|\t| # tab delimit fields - uncomment to enable " done