A variant of Alex's suggestion (below):

find . -type d -name "[0-9]*" -print | while read dir
do
    (
        cd $dir;
        for f in *.ly
        do
            lilypond $f
        done
    )
done

I've typed this directly in my mail client without testing it, so it's to be expected that some details will need correction. Sorry about that.


            Christopher W.


*From*:         Álex R . Mosteo
*Subject*: Re: (somewhat OT:) lilypond calling bash script questions
*Date*:         Wed, 09 May 2012 11:37:47 +0200
*User-agent*:   KNode/4.8.3

-----------------------------------------------------------------

Urs Liska wrote:

/  Please excuse if I post a linux question here, but I'd prefer not to/
/  have to find a dedicated forum and subscribe there first .../
/  /
/  I have a project with more than two dozens of lilypond scores. For/
/  several reasons I have them in individual files which I can't \include/
/  in a master file./
/  I would like to write a script that allows me to compile all .ly files/
/  in one run./

Another shot: if what you need is to compile all *.ly below a folder, this
might serve:

find . -name '*.ly' | while read i; do lilypond "$i"; done

Using read takes care of whitespace.

Or, more compact:

find . -name '*.ly' -exec lilypond '{}' \;

Although this won't work if the file must be inside a folder complying with
the number pattern.

Alex.

/  For this I need the following which I didn't find through Google:/
/  How can I sequentially cd to all subdirectories that start with a number?/
/  What I want is to do/
/  /
/  cd 01_01_.../
/  lilypond *.ly/
/  cd ../
/  cd 01_02_.../
/  ../
/  /
/  in a form like/
/  /
/  for dir in [get me all directories starting with a number]/
/  do/
/  cd $dir/
/  lilypond *.ly/
/  cd ../
/  done/
/  /
/  This _has_ to be absolutely simple, but I didn't manage do find out how/
/  so far./
/  /
/  Many thanks for any assistance./
/  Urs/



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to