Before I reach for my editor and write a small tool myself:
Is there a simple unix/gnutool that can increment numbers persistently. Something along the lines of:
$ increment
#=> 1
$ increment
#=> 2
$ exit
$ increment
#=> 4
It can store the number on disk (~/.increment) or anywhere else.
Bonuspoints for "named" numbers, like $ increment --name=foo
; where there are incrementers per name.