shithub: sm2

Download patch

ref: 511dcc30917db425043ebb6238a8333b5c36ab4d
parent: 943914d639b29fbd6a40d3df941c9947a5b555e9
author: qwx <qwx@sciops.net>
date: Tue Aug 31 20:50:13 EDT 2021

add sm2geradd: add troff and db entries from preformatted files

--- /dev/null
+++ b/bin/sm2geradd
@@ -1,0 +1,18 @@
+#!/bin/rc
+awk -F'	+' -v 'p=/usr/qwx/p/sm2/ger' -v 'dict=/usr/qwx/p/sm2/ger/db' '
+$1 == ""{
+	print "\n" $0 >>last
+	close(last)
+}
+$1 != ""{
+	f=$1
+	gsub(" ", ".", f)
+	last=p "/" f ".t"
+	if(system("test -f " last) == 0)
+		print f ": appending to existing file"
+	else
+		print "2.5 0 0 0 " f ".pdf" >>dict
+	printf "%s\n.BP\n%s\n\n%s\n", $1, $1, $2 >>last
+	close(last)
+}
+' $*