I think this is a bashism. Perhaps simply `page=$((page+1))`?