]> granicus.if.org Git - python/commitdiff
Script to convert things like <C/> and <Cpp/> to &C; and &Cpp;. This is
authorFred Drake <fdrake@acm.org>
Tue, 24 Nov 1998 17:38:49 +0000 (17:38 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 24 Nov 1998 17:38:49 +0000 (17:38 +0000)
something that con't be done with the DOM as far as I can tell.

Doc/tools/sgmlconv/fixgenents.sh [new file with mode: 0755]

diff --git a/Doc/tools/sgmlconv/fixgenents.sh b/Doc/tools/sgmlconv/fixgenents.sh
new file mode 100755 (executable)
index 0000000..220e356
--- /dev/null
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+#  Script to fix general entities that got translated from the LaTeX as empty
+#  elements.  Mostly pretty bogus, but works like a charm!
+
+if [ "$1" ]; then
+    exec <"$1"
+    shift 1
+fi
+
+if [ "$1" ]; then
+    exec >"$1"
+    shift 1
+fi
+
+sed '
+s|<ABC/>|\&ABC;|g
+s|<ASCII/>|\&ASCII;|g
+s|<C/>|\&C;|g
+s|<Cpp/>|\&Cpp;|g
+s|<EOF/>|\&EOF;|g
+s|<NULL/>|\&NULL;|g
+s|<POSIX/>|\&POSIX;|g
+s|<UNIX/>|\&UNIX;|g
+' || exit $?