I need to convert about 12000 TIF files in many directories, and try to write bash-script:
#!/bin/bash
find -name "*.tif" | while read f
do
convert "$f" "${f%.*}.png"
rm -f "$f"
done
Why it say: x.sh: 6: Syntax error: end of file unexpected (expecting "do") and what I should to do?
Great thanks to you all, men, but I was cheated: the computer on which this should be run out works under Windows. I don't know how to work with strings and cycles in DOS, now my script look like:
FOR /R %i IN (*.tif) DO @ (set x=%i:tif%png) & (gm convert %i %xtif) & (erase /q /f %i)
%i - one of the .tif files.
%x - filename with .png extension
gm convert - graphics magick utility, work similarly with image magick's convert on linux.