summaryrefslogtreecommitdiffstats
path: root/Doc/tools/sgmlconv/fixgenents.sh
blob: 6fa36f45030f9b03030d0ad05a86dbc1a11a9c46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/sh
#
#  Script to fix general entities that got translated from the LaTeX as empty
#  elements.  Mostly pretty bogus, but works like a charm!
#
#  Removes the leading XML PI that identifies the XML version, since most of
#  the XML files are not used as top-level documents.

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/>|C++|g
s|<EOF/>|EOF|g
s|<LaTeX/>|LaTeX|g
s|<NULL/>|NULL|g
s|<POSIX/>|POSIX|g
s|<UNIX/>|Unix|g
s|<e/>|\\|g
s|<geq/>|\&ge;|g
s|<ldots/>|\&hellip|g
s|<leq/>|\&le;|g
s|<version/>|\&version;|g
s|<ABC>|ABC|g
s|<ASCII>|ASCII|g
s|<C>|C|g
s|<Cpp>|C++|g
s|<EOF>|EOF|g
s|<LaTeX>|LaTeX|g
s|<NULL>|NULL|g
s|<POSIX>|POSIX|g
s|<UNIX>|Unix|g
s|<e>|\\|g
s|<geq>|\&ge;|g
s|<ldots>|\&hellip|g
s|<leq>|\&le;|g
s|<version>|\&version;|g
' || exit $?