Just as an exercise and to pass some time, I'm looking to recreate adduser in perl. The syntax of /etc/passwd requires a userid and groupid number for the new user. adduser will default the userid to the next available, but I don't know how it determines that. Does it look in /etc/passwd, or is there another file with every userid in use?
Thanks for any help you can spare