Carl D. Sorensen wrote:
This was a very simple script.  I learned a good bit of scripting with
the help of Patrick Horgan a while back when I was writing my lily2image
script.  Here's the script for any interested folks (first I did
"convert-ly -e *.ly" on the whole directory):

#!/bin/bash

#*****************************************#
# Run Lilypond on a lot of files and save #
# the terminal output in text files       #
#*****************************************#

for LILYFILE in *.ly
do
   STEM=$(basename "$LILYFILE" .ly)
   echo "running $LILYFILE..."
   lilypond --format=png "$LILYFILE" >& "$STEM".txt
   rm "$STEM".ps
done


Cool!  I still think that you ought to put it all (including the grep part)
into a single script and store it in the source tree.  And it ought to be
added to the CG so that we have it tracked for the next time we release a
stable version (I assume it will happen quickly, once Graham gets home from
Singapore -- although maybe going to Scotland doesn't qualify as "home").


I'd be very pleased if it were added to the CG and source tree but I don't have the push privileges to put it there, so I'll attach it to this email with the name "check-snippets". I didn't put the "convert-ly -e" command into the script because for reasons unknown to me I feel like it belongs as a separate process. I did stick the grep command in at the end and tested it again--works just fine. :) I wasn't certain whether it would wait until all the files had been run before grepping but it did. It finished looping and then moved on to the grep command.

I looked through the convert-ly.py script and I feel now as though I need to learn some Python. I especially like the way it deals with command-line options--much more intuitive than what I've been doing with bash scripting. Maybe I'll experiment a bit with the convert-ly rules on my own copy of the script and see what I can learn. :)

Jon
--
Jonathan Kulp
http://www.jonathankulp.com
#!/bin/bash

#*****************************************#
# Run Lilypond on a lot of files and save #
# the terminal output in text files       #
#*****************************************#

for LILYFILE in *.ly
do
  STEM=$(basename "$LILYFILE" .ly)
  echo "running $LILYFILE..."
  lilypond --format=png "$LILYFILE" >& "$STEM".txt
  rm "$STEM".ps
done

grep failed *.txt
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to