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]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Smith 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' ...

- -- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
When a stupid man is doing something he is ashamed of, he always
declares that it is his duty.
    -- George Bernard Shaw

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iQFDBAEBAgAtBQJFEbODJhhodHRwOi8vd3d3LnBvYm94LmNvbS9+dG16L3BncC90
bXouYXNjAAoJEEMlk4u+rwzj9zgH/0ztz2e9XWN7+sjJDXaRdUiNeh0Qk9VYwfTP
6DFkOZ9r7/GkHbovdw/ZPrPIWlhSdFsZbjlb57dS/ySS8ZFsRJwGlZBZxfncs/kV
CjA/t+I5L4CQiEiS6/+DJi4TF1N3qMUrzgTFZTnKstvnSH9JZax+kdnaSrbQYuqw
99FdNMaaWEggSiBbMu3ANkPZ1HgOA9SOP4aAHbEZRylPva7FwMe36IptlxYSytbB
1H1xPGCZ8cruGd0We4BO1l/vWjE/BPvrtD0JLckJMGeCBgCY+bs85A7iRSWwjta6
kihIbcuchMnWYW/q+zgJ2RAPl9Rai8ZZz73/SX8YLBTKJ16Tok4=
=gP8f
-----END PGP SIGNATURE-----

-- 
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