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


--
[EMAIL PROTECTED] mailing list

Reply via email to