I'm making a shell script to efficiently "thumbnalize" lotsa PNG images and convert them into JPG and also watermark their respective PNG sources. The problem is, after some "runtime", i need to delete the ".png" at the end of the variable "$img" (ls *png) , so i can save it as "something.jpg" and not "something.png.jpg".
I tried to use cut and sed but they don't work with variables (i think), a workaround is to "rename" the jpg images after saving them... but i would like to just remove the last 4 char of the variable at runtime and save them correctly.
Thank you in advance.



Adv Reply





Bookmarks