in simple I want to execute one command over many files and am trying to do that with a for do done
loop.
dwebp foo.webp -o ./PNGs/foo.png
is the command that I want to execute over all files that correspond to *.webp
in my current directory.
I am able to get the /PNGs/foo.png
working by doing
for f in *.webp; do echo "$f" "${f%.webp}.png"; done
. I'm now however not able to use $f
as the original file name (which is still needed).
The fact that I am using the ${f%.webp}.png
without really understanding why or how it works doesn't help...
So, does anyone know how I'd be able to run the dwebp foo.webp -o ./PNGs/foo.png
command with a for do done
loop, or a better way to achieve the same thing?