1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-19 21:49:22 +00:00
Files
amiga-tz/workman.sh
Paul Eggert 09d35582da Simplify use of URLs in text files.
In several cases our text files had commentary like this:
# Egypt to cancel daylight saving time
# <a href="http://www.almasryalyoum.com/en/node/407168">
# http://www.almasryalyoum.com/en/node/407168
# </a>
where lines 2 and 4 let the file be viewed by a browser with the
URL being clickable.  In practice this approach does not work with
many modern browsers (I tested with Firefox and with Chrome) and
it clutters up the data, so in cases like the above this patch
removes lines 2 and 4.
(Problem reported by Steffen "Daode" Nurpmeso.)
2014-06-15 17:38:04 -07:00

33 lines
558 B
Bash

#! /bin/sh
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# Tell groff not to emit SGR escape sequences (ANSI color escapes).
GROFF_NO_SGR=1
export GROFF_NO_SGR
echo ".am TH
.hy 0
.na
..
.rm }H
.rm }F" | nroff -man - ${1+"$@"} | perl -ne '
binmode STDIN, '\'':encoding(utf8)'\'';
binmode STDOUT, '\'':encoding(utf8)'\'';
chomp;
s/.\010//g;
s/\s*$//;
if (/^$/) {
$sawblank = 1;
next;
} else {
if ($sawblank && $didprint) {
print "\n";
$sawblank = 0;
}
print "$_\n";
$didprint = 1;
}
'