#!/bin/bash cd "$(dirname "$(readlink -e "$0")")" masterMakefile=$( ls -l ../*/Makefile \ | sort -k2n,2 \ | tail -n1 \ | sed 's@^.* @@' ) for s in *.cap *.capx *.xml *.mxl; do s="${s%.*}.ly" d="../$( echo "$s" \ | sed ' s@^.*/@@ s@\.ly$@@ s@ @_@g s@ä@ae@g s@ö@oe@g s@ü@ue@g s@Ä@Ae@g s@Ö@Oe@g s@Ü@Ue@g s@ß@sz@g ' )" [ -d "$d" ] && continue timeout 10 make "$s" || continue mkdir "$d" mv "$s" "$d/${d#*/}.ly" ln "${masterMakefile}" "$d" git add "$d" git commit "$d" -m "${d#*/} neu" done