I want to compress image files and wrote the following bash script:
for i in *.png; do convert $i -quality 100% $i-comp.jpeg; done;
When I run it I get filenames like 48.png-comp.jpeg
. I only want to have like 48-comp.jpeg
, so basically removing the .png
part of the filename.
I tried using this ${$i/.png/}
, which gives me an error message.
Any suggestions how to do this?