Convert .flac and .ape to mp3
vas at mpeks.tomsk.su
Sat Jan 6 08:55:37 UTC 2018
> > So eventually I will need to write a script to process all the *.ape
> > files, probably with bchunk. Which brings the following question. If
> > the file and directory names have spaces in them, a simple loop like
> > this:
> > #!/bin/sh
> > for i in `find . -iname '*.ape'`
> > do
> > do_something $i
> > done
> > breaks on spaces.
> > What is the sh magic to handle such filenames?
> do_something "$i"
Nope, these quotes make no difference, they are too late.
The problem is in the "for " line, it cannot differentiate spaces _in_
filenames and _between_ filenames. Look:
$ touch "this is a long file name.ape"
+ find . -iname '*.ape'
+ echo ./this
+ echo is
+ echo a
+ echo long
+ echo file
+ echo name.ape
I'm sure the solution exists, it must be a very common case.
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
More information about the freebsd-questions