Use the basename command in sh-utils...

for file in $( find . -iname '*.tga' | sort | xargs -i basename "{}" ".tga" )
do
   convert $file $file.png
done

Of course, I think you have to use xargs in combination. Probably someone knows a 
better way though.


>>I've got a huge batch of targa images that I need to convert to png, as
>>I don't want to convert each image individually I thought about writing
>>a small script to do this for me. I thought about something along the
>>lines of

>>for file in $( find . -name '*.tga' | sort )
>>do
>>   convert $file $file.png
>>done

>>but as expected this leaves the .tga extension on the file name, before
>>the png extension. How can I remove the .tga extension on the file?


--
[EMAIL PROTECTED] mailing list

Reply via email to