On Sun, 2003-03-23 at 10:56, Renat Golubchyk wrote:
> Hi!
>
> AM> I've got a huge batch of targa images that I need to convert to png, as
> AM> I don't want to convert each image individually I thought about writing
> AM> a small script to do this for me. I thought about something along the
> AM> lines of
>
> AM> for file in $( find . -name '*.tga' | sort )
> AM> do
> AM> convert $file $file.png
> AM> done
>
> AM> but as expected this leaves the .tga extension on the file name, before
> AM> the png extension. How can I remove the .tga extension on the file?
>
> Try this one:
>
> for file in $( find . -name '*.tga' | sort )
> do
> output=$(echo $file | sed s/tga$/png/)
> convert $file $output
> done
>
>
> Regards,
> Renat
>
>
> --
Or this:
for file in $( find . -name "*.tga" -print | sort )
do
output = `basename $file .tga`".png"
convert $file $output
done
--
Tony Rein <[EMAIL PROTECTED]>
--
[EMAIL PROTECTED] mailing list