Help with either bash or find...

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

 



 
It has been awhile since I have been programming in
bash or using the 'find' command and what I am trying
to do is to figure out how to run a command to decode
all my .mpc files into wav as follows:
 
1. Find all MPC files
2. Run each file through mppdec
 
I tried to do this using the 'find' command or even with a
bash script.
 
Using find:
========
find *.mpc -type f -exec mppdec '{}' `echo {} | sed s/.mpc/.wav` \;
** fails because you cannot use {} more than once and also exec is mangled.
 
I recalled using xargs from my past, but cannot remember how to do it.
 
find *.mpc -type f -print0 | xargs ?????
 
Since I had used find/xargs in the past, I have not encountered cases where
filenames can have spaces or other characters embedded, so this is new
for me.  I was not able to get around this issue with find nor with bash scripts.
 
Using bash:
=========
#!/bin/bash
 
for i in $*
do
  F=`echo $i | sed s/.mpc//`
  mppdec $F+".mpc" $F+".wav"
done
 
Any ideas?
 
Thanks-
Dan

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.11/1422 - Release Date: 5/8/2008 5:24 PM

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