Mark Knecht ([EMAIL PROTECTED]) scribbled:
> Hi,
>    I don't have a single book on Linux. (Amazing...) Can someone
> recommend a simple book on command line stuff, or better yet a good
> web site on this topic?

Sorry, I picked up most of it from fiddling around, but on to your
problem...

>    For instance, I wanted to run a specific command on every file in a
> directory which will create a new file, so I need to do
> 
> command    file1.wav    file1-convert.wav
> 
> I need to take each name, create a new name to build the actual
> command that gets run and then do that for every file in the
> directory, or even in a hierarchy of directories.


# for file in `ls *.wav`
> do
> newname=`echo ${file} | sed -e "s/\.wav$/-convert.wav/"`
> command -i ${file} -o ${newname} 
> done

chug...chug...chug

and it's done.  But this will only work on files in one subdirectory.
For recursive operations, replace the first line with this:

# for file in `find . -type f -iname "*.wav" -print`

hth,

jason.
-- 
[email protected] mailing list

Reply via email to