File: mkstand.bash

package info (click to toggle)
ibm-3270 4.0ga12-3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 17,740 kB
  • sloc: ansic: 120,111; sh: 4,284; makefile: 822; pascal: 798; perl: 344; exp: 184; tcl: 94
file content (31 lines) | stat: -rwxr-xr-x 515 bytes parent folder | download | duplicates (20)
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
#!/usr/bin/env bash
# Make a standalone webpage from an xxx-body webpage.
#  mkstand 'title' infile outfile

if [ $# -ne 3 ]
then	echo >&2 "usage: $0 'title' infile outfile"
	exit 1
fi

. ./version.txt

tf=/tmp/mkstand$$
rm -f $tf
trap "rm -f $tf" exit
trap "exit" INT QUIT HUP TERM

(cat <<EOF
<html>
 <head>
 <title>$1</title>
 <link HREF="http://www.w3.org/StyleSheets/Core/Steely" TYPE="text/css" REL="stylesheet">
 </head>
 <body>
EOF
 sed "s/CYEAR/$cyear/g" $2
cat <<EOF
 </body>
</html>
EOF
) >$tf
mv $tf $3