On 10/10/05, Spider (D.m.D. Lj.) <[EMAIL PROTECTED]> wrote:
> On Sun, 2005-10-09 at 19:06 -0700, Mark Knecht wrote:
> > 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?
> >
> >    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.
> >
> > Thanks,
> > Mark
>
>
>
> For bash / zsh and other advanced(?-) shells:
>
> for f in *.wav; do command "$f" "${f/.wav/-convert.wav}";done
>
> The " " are there to prevent files with spaces in them (evil!) from
> becoming too annoying and appearing as multiple commandline arguments.
>
>
> //Spider
>

Thanks to all for the great answers and pointers. I appreciate it very much.

Cheers,
Mark

-- 
gentoo-user@gentoo.org mailing list

Reply via email to