summaryrefslogtreecommitdiff
path: root/concat.sh
blob: 9b176a151f2f909ea792a0185055619ff85bfc61 (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
#!/bin/sh

translation=$1
title="$2"

echo '<?xml version="1.0" encoding="UTF-8"?>'
printf '<XMLBIBLE type="x-bible" biblename="%s" status="v">\n' "$title"
echo '<INFORMATION>'
echo "<title>${title}</title>"
echo '<format>Zefania XML Bible Markup Language</format>'
echo '</INFORMATION>'
j=1
cat ${translation}/book-list | while read buch
do
	echo "<BIBLEBOOK bname=\"$buch\" bnumber=\"$j\">"

	buchdir=$(echo "$buch" | sed "y/äöü /aou_/")
	i=1
	while [ -e "${translation}/chapters/$buchdir/$i.xml" ]
	do
		cat "${translation}/chapters/$buchdir/$i.xml" | sed 1d
		i=$((i+1))
	done

	j=$((j+1))
	echo "</BIBLEBOOK>"
done
echo '</XMLBIBLE>'