#!/bin/sh

bn=${1%.ly}

mv $bn.ly $bn.ly.orig
sed -e '/^\\header{/,/^}/d' $bn.ly.orig > $bn.ly.tmp

cat - $bn.ly.tmp > $bn.ly <<EOF
\header{
  title = "Musical Diary"
  subtitle = "$bn"
  composer = "Felix Rabe"
  dedication = "Dedicated to the victims of the war on Iraq, lasting 2003--????"
  head = "Musical Diary --- $bn"
  commonsnote = "Licensed under the Creative Commons Attribution License, http://creativecommons.org/licenses/by/1.0"
  copyright = \commonsnote
  footer = \commonsnote
  tagline = \commonsnote
}
EOF

rm -f $bn.ly.tmp

