I've never understood why this is such a big issue, couldn't it be handled with a sed one-liner? They don't actually need to be any specific number from what I've gathered, just sequential, so couldn't every damn id problem ever be solved with a simple "cat idconfigfile | sed s/endofline/1++"...