LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2007, 02:23 PM   #1
WAIF
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Rep: Reputation: 0
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?
 
Old 02-27-2007, 02:40 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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)
 
Old 02-27-2007, 02:46 PM   #3
WAIF
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Original Poster
Rep: Reputation: 0
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

Last edited by WAIF; 02-27-2007 at 02:50 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: how to get time (in seconds) elapsed since creation of a file? J_Szucs Linux - General 6 12-28-2008 12:28 AM
File Creation: bash shell stapletone Linux - Newbie 2 09-24-2006 01:35 PM
User Creation in solaris siddhartha.das Solaris / OpenSolaris 3 03-05-2005 02:14 PM
Automatic user creation Skorpio Linux - Networking 3 09-25-2003 11:45 AM
GUI for new user creation coolamit78 Linux - Software 6 09-06-2003 05:36 PM


All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration