Want to make a bash script that removes a png file if a jpg has the same name.
And I don't know quite what to do :confused:
I want to find all .png images in a directory, and remove them if there exists in the same directory a .jpg which has the same filename (not including extension). It seemed that this was the right place to learn the tricks I need. Any tips? |
Code:
for file in *.jpg; do The expression "${file%.jpg}.png" changes the extension to .png using name expansion. |
Yay thanks! My skills do need to improve, but the learning is the fun part anyways, so I don't mind that at all.
|
All times are GMT -5. The time now is 09:57 AM. |