use typed int, not local var (bug on hp-ux bash 4.3.27(1)-release)
auto-increment broken older bash on solaris