[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert-ly question
From: |
David Kastrup |
Subject: |
Re: convert-ly question |
Date: |
Sun, 18 May 2014 09:35:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Martin Tarenskeen <address@hidden> 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
- Re: convert-ly question, (continued)
Re: convert-ly question, Patrick or Cynthia Karl, 2014/05/17
Re: convert-ly question, Martin Tarenskeen, 2014/05/18