You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
828 B
25 lines
828 B
#!/bin/bash
|
|
|
|
# Make full canticle files from comedy-xml.d
|
|
|
|
xml_dir=../comedy-xml.d
|
|
|
|
canticles=( 'inferno' 'purgatorio' 'paradiso' )
|
|
|
|
for canticle in "${canticles[@]}";
|
|
do
|
|
canticle_dir="$xml_dir/$canticle-xml.d/"
|
|
canticle_complete=$xml_dir"/$canticle-complete.xml"
|
|
cp ./canticle-base.xml $canticle_complete
|
|
sed -i "s/CANTICLE/The\ Complete\ ${canticle^}/" $canticle_complete
|
|
echo -e "\t\t<$canticle>" >> $canticle_complete
|
|
for canto in $canticle_dir*;
|
|
do
|
|
canto_text="$(xmlstarlet sel -t -c "_:TEI/_:text/_:canto" $canto | sed "s/^/\t/g")"
|
|
echo -e "$canto_text" >> $canticle_complete
|
|
done
|
|
echo -e "\t\t</$canticle>" >> $canticle_complete
|
|
echo -e "\t</text>" >> $canticle_complete
|
|
echo "</TEI>" >> $canticle_complete
|
|
sed -i 's/<canto\ xmlns=\"http:\/\/www.tei-c.org\/ns\/1.0\"/\t\t<canto/g' $canticle_complete
|
|
done
|
|
|