comparison bin/newdoc @ 0:2aa53823fb21

new repo
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sat, 06 Jun 2026 10:19:04 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:2aa53823fb21
1 #!/bin/bash
2 date=$(date +"%e %b %Y")
3 d=/home/ht/lib/xml/
4 p=$(pwd)/
5 while :
6 do
7 dd=${d#/*}
8 pp=${p#/*}
9 x=${dd%%/*}
10 y=${pp%%/*}
11 if [ "$x" != "$y" ]
12 then
13 path=$(echo $pp | sed 's/[^/][^/]*/../g')$dd
14 break
15 fi
16 d=${dd#*/}
17 p=${pp#*/}
18 done
19 cat << EOF
20 <?xml version='1.0'?>
21 <?xml-stylesheet type="text/xsl" href="${path}doc.xsl" ?>
22 <!DOCTYPE doc SYSTEM "${path}doc.dtd" >
23 <doc>
24 <head>
25 <title></title>
26 <author>Henry S. Thompson</author>
27 <date>$date</date>
28 </head>
29 <body>
30 <div>
31 <title></title>
32 </div>
33 </body>
34 </doc>
35 EOF