LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   User Creation Bash (https://www.linuxquestions.org/questions/linux-newbie-8/user-creation-bash-533003/)

WAIF 02-27-2007 01:23 PM

User Creation Bash
 
Ok i need to make a script for class that creats users and groups in a script.

so i made a text file called employ.txt

looks something like this:

John Doe jdoe IT
Mary Lamb mlamb Account

So, i need to make a script that creates the users jdoe, and mlamb using bash, and assigning them to there groups IT, or Account. anyone got any help or know a website i could look at one for some ideas?

pixellany 02-27-2007 01:40 PM

What kind of a class are we talking about? eg Have you had some basic instruction in scripts?

Go to tldp.org and get "Bash Guide for Beginners" by Machtelt Garrels. Also there is something called Advanced BASH Scripting Guide (or something like that)

WAIF 02-27-2007 01:46 PM

class
 
its a linux system admin class and there really is no instructions, jus go out and find out how to do it.
this is what i got so far but it add everything in the text as users. i need to know were to put the awk for only the third field for users and awk user -g to assign them to the right groups.

#!/bin/sh
for i in `more employ.txt `
do
echo $i
adduser $i
done


All times are GMT -5. The time now is 05:31 PM.