Add suffix to all files in the directory with an extension
bash
Solution
for file in *.png; do
mv "$file" "${file%.png}_3.6.14.png"
done
`${file%.png}` expands to `${file}` with the `.png` suffix removed.
Problem
How to add a suffix to all files in the current directory in bash? Here is what I've tried, but it keeps adding an extra `.png` to the filename. ``` for file in *.png; do mv "$file" "${file}_3.6.14.png"; done ```