diff options
Diffstat (limited to 'Konzerte/2018_08_31/make')
-rwxr-xr-x | Konzerte/2018_08_31/make | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/Konzerte/2018_08_31/make b/Konzerte/2018_08_31/make new file mode 100755 index 0000000..8ed1e54 --- /dev/null +++ b/Konzerte/2018_08_31/make @@ -0,0 +1,73 @@ +#!/bin/bash + +set -e + +cd "$(dirname "$0")" + +teile=( + Die_beste_Zeit_im_Jahr_ist_mein + Denn_er_hat_seinen_Engeln_ + Gott_hat_mir_laengst_einen_Engel_gesandt + Befiehl_dem_Herren_deine_Wege + Tanzen_und_Springen + Aennchen_von_Tharau + Schoen_ist_die_Erde + Fuellt_die_Kruege_mit_Wasser + Ich_sing_dir_mein_Lied + Hoere_nun_Herr_die_Bitten + Bleib_bei_mir_Herr + Abendruhe + Viele_verachten_die_edele_Musik +) + +rm -f *.pre + +for teil in "${teile[@]}" +do + ( + cd ../../${teil} + sed -n ' + s/^[^:]*%\.pdf.*:\s*// + T + s/%/'"${teil##*/}"'/g + p + ' Makefile | \ + tr ' ' '\n' | \ + grep '\.pre$' | \ + xargs -r make SPRACHEN_REGEX=/textSII/d "$@" + ) +done + +{ + printf '\n\n' + cat alles.ly + printf '\n\n' +} | \ + while read -r line + do + if [[ "${line}" = '%LOOP%'* ]] + then + loopLines="${loopLines} +${line#%LOOP%}" + else + if [ -n "${loopLines}" ] + then + for teil in "${teile[@]}" + do + echo "${loopLines}" | \ + sed " + s|%TEIL%|${teil}|g + s|%TEIL-BASE%|${teil##*/}|g + /%IF \([^=%]\+\)!=\1%/d + s|%IF [^=%]\+!=[^=%]\+%||g + s|%IF \([^=%]*[^=!%]\)=\1%||g + /%IF [^=%]\+=[^=%]\+%/d + " + done + unset loopLines + fi + echo "${line}" + fi + done > alles.pre + +lilypond alles.pre |