[NTLUG:Discuss] using convert to work on an intire CD

Kevin Brannen kbrannen at pwhome.com
Mon Oct 18 08:53:06 CDT 2004


Bobby Wrenn wrote:

> I want to take a clipart CD of WMF files and convert the whole CD.
>
> I know a shell script ImageMagick (convert) can do it I just don't 
> know exactly how to get a script to recurse the CD tree and recreate 
> it in the destination directory in the new file format.
>
> Any help greatly appreciated. I just started back to school (after 20 
> years) and don't have time to read up on it and my wife needs to be 
> able to browse the images in jpeg format.
>
> TIA
> Bobby


You'll probably want something along the lines of:

# cd to the top of the CD dir, whereever that is for you
cd /media/cdrom

# where you want to duplicate to
DEST=$HOME/whereever
[ -d $DEST ] || mkdir $DEST

# find, convert, copy (change extenstion as needed)
find . -name "*.wmf" -print |
while read file
do
   #convert  [  [ options ... ] [ input_file ...  ] ... [ output_file ] ]
   convert ...opt... $file $DEST/$file
done

HTH,
Kevin

p.s. if you want to test your systems multitasking capabilities, put a 
"&" on the end convert command :-)



More information about the Discuss mailing list