Martin Tarenskeen <[email protected]> writes:
> On Sun, 18 May 2014, Graham King wrote:
>
>> If you're going to use xargs, be careful of .ly files containing whitespace
>> in the filename. The GNU implementations of find and xargs support an
>> option for that:
>>
>> find . -name \*.ly -print0 | xargs -0 -n 1 convert-ly -e
>
> The commandline solution for the original question is getting more
> complicated with every new posting.
The above makes no actual sense. Using xargs with -n 1 means "please
only one argument per call" while the whole point of combining find with
xargs instead of using -exec is to process more than one argument per
call.
> Luckily I don't need this kind of commandline virtuosity. I think I
> can do what I need with one of the first and easiest suggestions
>
> convert-ly -e **/*.ly
>
> That's something my lazy brains can understand and memorize ;-)
Well, my solution as well as the above overcomplicated one is based on
the premise "please only one argument per call". It would appear that
convert-ly _does_ accept more than one argument per call. Doh.
Now once convert-ly -e **/*.ly exhausts the maximum command line length,
you might want to revert to
find . -name \*.ly -print0 | xargs -0 convert-ly -e
again. But your find might not support print0, turning this into the
less "foolproof"
find . -name \*.ly -print | xargs convert-ly -e
or, _if_ you use GNU find,
find -name \*.ly -exec convert-ly -e {} +
which is sort of using a built-in xargs (when using + instead of \;) for
building command lines as long as possible.
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user