File: htmlise.sh

package info (click to toggle)
espresso 6.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 311,040 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,502; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (28 lines) | stat: -rwxr-xr-x 481 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

if [ $# -ne 1 ]; then
    echo "Usage: $0 txt_docfile"
    exit 1
fi

docfile=$1

echo "
<html>
  <body>
    <pre>" > head.$$

echo "
    </pre>
  </body>
</html>" > tail.$$

# filter out line: "*** FILE AUTOMATICALLY CREATED ..."
awk '$0 !~ /FILE AUTOMATICALLY CREATED: DO NOT EDIT, CHANGES WILL BE LOST/ { print; }' $docfile > body.$$
sed 's/</\&lt\;/g' body.$$ | sed "s/>/\&gt\;/g" - > body2.$$

cat head.$$ body2.$$ tail.$$
rm -f head.$$ body.$$ body2.$$ tail.$$