RE: [SOLVED] Help with either bash or find...

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

 



Gordon Messmer wrote:
|Daniel Challen wrote:
|> for musepack_file in $(find -name \*.mpc -type f) ; do
|> 	mppdec "$musepack_file" "$(echo $musepack_file | sed 
|s/mpc$/wav/)"
|> done
|>   
|
|Doesn't work for files with spaces in their names.

If you put the above code in bash, you can
control the IFS variable:

#!/bin/bash

# Uncomment if needed.
#DIR="/media/Music/MPC/"

FND=$(find $DIR -name \*.mpc -type f)

# Newline delimiter
IFS="
"
for musepack_file in $FND; do
 wav="$(echo $musepack_file | sed s/.mpc$/.wav/)"
 bw=$(baseline $wav)
 if [ ! -f $wav ]; then
  echo " + [$bw]"
  mppdec "$musepack_file" "$wav"
 else
  echo " - [$bw]"
 fi
done

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