Convert .flac and .ape to mp3

Andreas Perstinger andipersti at gmail.com
Sat Jan 6 16:12:42 UTC 2018


On 2018-01-06 16:17, Victor Sudakov wrote:
> Michael Ross wrote:
>> > #!/bin/sh
>> > for i in `find . -iname '*.ape'`
>> > do
>> >   do_something $i
>> > done
>> >
>> > breaks on spaces.
>> >
>> > What is the sh magic to handle such filenames?
>> >
>> 
>> xargs, you may want to run a few conversions in parallel:
>> 
>> find . -iname '*.ape' -print0 | xargs -0 -I% -P<parallel_runs> convert %  %.mp3
> 
> I'm sure there are many ways to solve the problem, including writing a
> C program, but a solution in pure sh has its own value and appeal.

Well, you use already the find command, so why don't you use it's full 
power?

https://unix.stackexchange.com/questions/321697
(Why is looping over finds output bad practice?)

Bye, Andreas


More information about the freebsd-questions mailing list