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, Steven W. Orr <steveo@xxxxxxxxxxx> wrote:
=>Paul Smith wrote:
=>> On 9/20/06, Andy Green <andy@xxxxxxxxxxx> wrote:
=>> > >> 12\ Missa\ brevis\ in\ G,\ KV\ 140App,\ C1.\ 12\ Agnus\ Dei.wav
=>> > >
=>> > > Perhaps the best strategy is to eliminate all '\' and then use "$i".
=>> > > However, I do not know how to implement it.
=>> >
=>> > No Paul Howarth's method was best, the problem is probably coming from
=>> > the commas.  For example, can you do the sox by hand with that filename
=>> > even?
=>>
=>> Yes, I can, Andy.
=>
=>Hm well this works for me with the filename
=>
=>$ ls *.wav
=>12 Missa brevis in G, KV 140App, C1. 12 Agnus Dei.wav
=>
=>for i in *\ * ; do sox "$i" -r 44100 -t wav "output_$i" ; done
=>
=>You need the -t otherwise sox gets confused trying to work it out from the
=>suffix; because it contains dots in the file part it complains that the type "
=>12 Agnus Dei.wav" is unknown without -t.

find . -name \*.wav -print0 | \
   xargs -0 sox "{}" -r 44100 -t wav "output_{}"

I forget what the search criteria was. Just pee in the -name arg for
taste.

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
$

But 'find . -name \*.wav -print' gives me the complete list of wav
files in the directory.

Paul

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux