Re: Bash script for files with spaces in the filenames

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

 



jvian10@xxxxxxxxxxx (Jeff Vian) writes:
> On Thu, 2006-02-16 at 11:29 +0200, Dotan Cohen wrote:
> > #!/bin/bash
> > PWD=`pwd`
> > for file in `find $PWD -name "*.mp3"`
> > do
> >   eyeD3 --force-update --set-encoding=utf8 "$file"
> > done
> > 
> In the above construct $file gets the first part up to the delimiter
> (white space) for each part it reads, so it may not have the full file
> name.
> 
> I had a similar problem so I built something like this:

Just replace the for loop by a while loop:
find $PWD -name "*.mp3" | while read file

And you should be good to go...
-- 
Mathieu Chouquet-Stringer
    "Le disparu, si l'on vénère sa mémoire, est plus présent et
                 plus puissant que le vivant".
           -- Antoine de Saint-Exupéry, Citadelle --


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux