<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1609" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>It has been awhile
since I have been programming in</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>bash or using the
'find' command and w</SPAN></FONT><FONT face=Arial size=2><SPAN
class=984161315-09052008>hat I am trying</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>to do is to figure
out how to run a </SPAN></FONT><FONT face=Arial size=2><SPAN
class=984161315-09052008>command to decode</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>all my .mpc files
into wav as </SPAN></FONT><FONT face=Arial size=2><SPAN
class=984161315-09052008>follows:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>1. Find all MPC
files</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>2. Run each file
through mppdec</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>I tried to do
this using the 'find' command or even with a</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>bash
script.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008></SPAN></FONT><FONT
face=Arial size=2><SPAN class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>Using
find:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>========</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>find *.mpc -type f
-exec mppdec '{}' `echo {} | sed s/.mpc/.wav` \;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>** fails because you
cannot use {} more than once and also exec is mangled.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>I recalled using
xargs from my past, but cannot remember how to do it.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>find *.mpc -type f
-print0 | xargs ?????</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>Since I
had used find/xargs in the past, I have not encountered cases
where</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>filenames can have
spaces or other characters embedded, so this is
new</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>for me. I was
not able to get around this issue with find nor with bash
scripts.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>Using
bash:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>=========</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>#!/bin/bash</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>for i in
$*</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>do</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008> F=`echo $i |
sed s/.mpc//`</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008> mppdec
$F+".mpc" $F+".wav"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>done</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=984161315-09052008>Any
ideas?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>Thanks-</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=984161315-09052008>Dan</SPAN></FONT></DIV></BODY></HTML>
<BR>
<P><FONT SIZE=2>No virus found in this outgoing message.<BR>
Checked by AVG.<BR>
Version: 7.5.524 / Virus Database: 269.23.11/1422 - Release Date: 5/8/2008 5:24 PM<BR>
</FONT> </P>