Problems playing with file extensions
Ok, here is the issue. I am trying to write a script that will allow me to convert thousands of images in a directory into a different format. Here is what I am doing so far:
Code:
for i in *png; do convert $i ./jpg/$i.jpg; done file.png will become file.png.jpg I had created a revision of this script that will fix that and convert it to file.jpg instead, however, I can't remember the command I used in a certain step. I was hoping someone else here may be able to help me. Basically, it went something like this: Code:
for i in *png; do convert $i ./jpg/`command $i ".png"`.jpg; done |
Atleast in bash:
Code:
for i in *.png; do convert $i ./jpg/${i/.png/.jpg}; done |
All times are GMT -5. The time now is 03:18 PM. |