I want to rename all the files in a folder with numbers in their names, like
- Solution_01.vtu
- Solution_02.vtu
- Solution_03.vtu ...
to be
- Solution_201.vtu
- Solution_202.vtu
- Solution_203.vtu ...
where the additional constant (here 200) can be specified.
I've tried something along the lines of that suggested in Renaming a set of files to 001, 002, ... on Linux
i=200; temp=$(mktemp -p .); for file in solution_*.vtu
do
mv "$file" $temp;
mv $temp $(printf "solution_%0.3d.vtu" $i)
i = $((i+1))
done
but this doesn't work for me. Thanks for any help!