summaryrefslogtreecommitdiff
path: root/Konzerte/2017_10_08/make
blob: 151d179b32bc7a475580c6facba3b10c32f7474b (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash

set -e

cd "$(dirname "$0")"

teile=(
  Herr_groszer_Gott
  Halleluja
  Grosz_ist_der_Herr
  Fuellt_die_Kruege_mit_Wasser
)

rm -f *.pre

for teil in "${teile[@]}"
do
  (
    cd ../../${teil}
    make "$@" ${teil}.pre
  )
done

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"
      done
      unset loopLines
    fi
    echo "${line}"
  fi
done < alles.ly > alles.pre

lilypond alles.pre