lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (somewhat OT:) lilypond calling bash script questions


From: Urs Liska
Subject: Re: (somewhat OT:) lilypond calling bash script questions
Date: Tue, 08 May 2012 11:47:33 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Am 08.05.2012 11:36, schrieb address@hidden:
On 8 mai 2012, at 11:31, 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.
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

I only speak Python, but I can help you there

import subprocess

NUMBER_OF_DIRS = 10

for x in range(NUMBER_OF_DIRS) :
   subprocess.call("lilypond *.ly", shell=True, cwd="01_"+("%.2d" % 
x)+"_foobar")

Note that I haven't tested the above, so I can't guarantee it works and you'd 
have to adapt it to your individual case.

Cheers,
MS

Well, I don't speak Python, so I'll hope to get another response.

But from what I can decipher from your script I might have to express myself clearer: The condition for the inclusion of a directory is _only_ that it starts with a number. The dirs with scores in it are named according to opus number, thus starting with a two digit number, followed by an underscore and another two digit number. But the unique characteristic is that it begins with a number, as all other directories below the project root start with characters.

Thanks anyway
Urs
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

[Prev in Thread] Current Thread [Next in Thread]