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: Wed, 09 May 2012 16:37:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Thanks all for the generous feedback.

But the very simple solution that Jonas Olson posted quite early solved the issue.
"for dir in [0-9]*/;" was is exactly what I needed.

Best
Urs

Am 09.05.2012 16:31, schrieb Christopher Webster:

From: David Kastrup
Subject: Re: (somewhat OT:) lilypond calling bash script questions
Date: Wed, 09 May 2012 16:01:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Christopher Webster <address@hidden> writes:

> 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

find is looking _recursively_, arbitrarily deep.  It is the wrong tool
for the job.

-- 
David Kastrup

Apologies.  My misunderstanding.  I thought that recursion was the desired behaviour.  If not, then something more like this should do it:

for d in [0-9]*
do
    if test -d $d
    then
    (
        cd $d
        for f in *.ly
        do
            lilypond $f
        done
    )
    fi
done


Once again, I've typed this straight into the mail client without testing, so the obvious risks are present.

All the best

            Christopher W.




_______________________________________________
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]