I want to rename an image sequence with even numbers. The image sequence is already named in order 1.tif, 2.tif, 3.tif, 4.tif, etc but I want them to be named 2.tif, 4.tif, 6.tif, 8.tif etc. (I need them to stay in that order because they are animation frames)
I tried:
num=0; for i in *; do mv "$i" "$(printf '%04d' $num).${i#*.}"; ((num+=2)); done
but it loses the original order.