[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help using convert-ly recursively on Linux
From: |
Dmytro O. Redchuk |
Subject: |
Re: Help using convert-ly recursively on Linux |
Date: |
Fri, 3 Sep 2010 15:10:54 +0300 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Fri 03 Sep 2010, 07:39 Ralph Palmer wrote:
> Greetings -
>
> I'm running LilyPond on Ubuntu 9.10 (Karmic Koala).
>
> I'd like to run convert-ly against all of my .ly files that I have created,
> without having to manually change directories to each directory that
> contains a file I want to convert, and then run convert-ly against the files
> in that directory. "convert-ly -e *.ly" works in a single directory, but I
> can't figure out how to get it to work recursively through multiple
> directories. Assuming all the .ly files I have created are in a single
> directory hierarchy, like:
> /SheetMusic
> /Classical
> /Bach
> /ArtOfTheFugue
> /SoloCelloSuites
> /Beethoven
> /Sonatas
> /StringQuartets
> /Mozart
> /FolkMusic
> /NorthAmerican
> /EasternEuropean
> and that the directory structure might change (while always beginning from a
> single parent directory), can anyone either point me in the right direction
> or share a script file (preferably python or bash, since I'm more likely to
> understand what's going on with those) to run convert-ly recursively on the
> files each and all of the directories under /SheetMusic?
I would start with smth like this:
$ find . -type d | xargs -L 1 convert_all_here
`find' will print all directories from current dir and below.
`convert_all_here' could be like this:
#------------8<--------------------------
for ly in *.ly; do
if [ -e $ly ] ; then
convert-ly $ly > ${ly%%.ly}_converted.ly
fi
done
#------------8<--------------------------
Not tested (sorry), but something like this should work.
--
Dmytro O. Redchuk
Bug Squad