Re: Automatic way of applying the same command to a bunch of files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/20/06, Todd Zullinger <tmz@xxxxxxxxx> wrote:
> Thanks, Steven and Andy. The last Andy's solution works fine. However,
> with Steven's one, I get the following:
>
> $ find . -name \*.wav -print0 | xargs -0 sox "{}" -r 44100 -t wav
> "output_{}"
> sox: Can't open input file '{}': No such file or directory

To use the {} replacement for the file, xargs should have the -i
option:

    ... | xargs -0 -i sox '{}' ...

Of course, the xargs manpage says that -i is deprecacted and you
should instead use -I replace-str.  You can make things more readable
this way as well:

    ... | xargs -0 -I wav sox 'wav' ...

It does not work either:

$ find . -name \*.wav -print0 | xargs -0 -I wav sox "{}" -r 44100 -t
wav "output_{}"
sox: Can't open input file '{}': No such file or directory
[...]

Paul


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux