I have a couple of files, let's say map-0.jpg (newest), map-1.jpg, map-2.jpg, ..., map-9.jpg (oldest). Now my cronjob downloads a new picture from the internet and should save it as map-0.jpg. All other files, however, should be newly enumerated (0 -> 1, 1 -> 2, and so on). Number 9, in my case, can be discarded.
Is there a handy bash-command that enumerates my files similar as logrotate does?
Thanks for help!