helgman
February 20th, 2006, 12:20 PM
Hi!
I've been bangning my head trying to figure this out but now I'm about to give up. I need to get information from a file and then use it to make new users on my system. The file with the users looks something like this:
Username FirstName LastName Group Password
My question is, how do I extract the information from the file and then use it to add the users? My plan is to add the user with useradd [Userrname] -c [FirstName],[LastName ] -g [Group] (does this have to be GID?), then do a passwd [Username]. (Guess my first question should be if this way is even possible.)
I don't really need a complete script, just a kick in the right direction (I need to learn this).
I've been bangning my head trying to figure this out but now I'm about to give up. I need to get information from a file and then use it to make new users on my system. The file with the users looks something like this:
Username FirstName LastName Group Password
My question is, how do I extract the information from the file and then use it to add the users? My plan is to add the user with useradd [Userrname] -c [FirstName],[LastName ] -g [Group] (does this have to be GID?), then do a passwd [Username]. (Guess my first question should be if this way is even possible.)
I don't really need a complete script, just a kick in the right direction (I need to learn this).