[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to compile all ly-files including subfolders
From: |
Daniel Berjón Díez |
Subject: |
Re: how to compile all ly-files including subfolders |
Date: |
Fri, 14 Nov 2014 17:17:45 +0100 |
On 14 November 2014 14:11, Ed Gordijn <address@hidden> wrote:
> Hi Urs,
>
> I'm not sure I do agree with your statement:
>
>> You can surely do what you want with a pure shell script, but Python may
>> be cleaner to read
>
> The 'pure shell' script looks like this:
>
> #!/bin/bash
>
> shopt -s globstar # to be able to use ** for sub-dirs
>
> for lyFile in **/*.ly
> do
> out="${lyFile%.ly}" # filename without .ly
> lilypond -o"$out" "$lyFile"
> done
Or even shorter, if slightly more arcane:
find . -name '*ly' -exec sh -c 'ly={}; lilypond -o "${ly%.ly}" "$ly"' \;
By the way, thanks for the ${$varname%ending} trick, I didn't know it;
I used to employ $(basename $varname ending) to achieve the same
effect but your way is a lot shorter. ;)
Re: how to compile all ly-files including subfolders, Flaming Hakama by Elaine, 2014/11/14
Re: how to compile all ly-files including subfolders, Stefan Thomas, 2014/11/17