Sponsored Content
Top Forums UNIX for Dummies Questions & Answers About adding users from a text file using bash Post 302954509 by RudiC on Tuesday 8th of September 2015 04:10:16 PM
Old 09-08-2015
Maybe. You should post WHAT doesn't work. I guess you're using a recent version of bash?
You read in a file name, but never read FROM that file. I bet you get a "command not found" error for the $(dir), and user_dets are never assigned to.
Try e.g.
Code:
while IFS=":" read user group home
  do useradd ...
  done < $dir

and report back.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding text to a file between lines

Suppose content of my first file: first line second line third line How can i insert text between "first line" & "second Iline" Any help?????/ (7 Replies)
Discussion started by: bishweshwar
7 Replies

2. Shell Programming and Scripting

Adding specific text and spaces to each line in a text file

Hi, I wanted to add specific text to each row in a text file containing three rows. Example: 0 8 7 6 5 5 7 8 9 0 7 9 7 8 9 0 1 2 And I want to add a 21 at the beginning of the first row, and blank spaces at the beginning of the second two rows. To get this: 21 0 8 7 6 5 5 7 8... (4 Replies)
Discussion started by: hertingm
4 Replies

3. Shell Programming and Scripting

adding text to a file

Hi All I am making a script in which.I have a problem i try to discribe. File1 content need to be append in file 2 but such as if content already exist then dont add. File1 IS Like this myname yourname hername hisname File2 %AddNameHere myname yourname hername hisname (3 Replies)
Discussion started by: aliahsan81
3 Replies

4. Shell Programming and Scripting

Adding Text To Middle Of File

Hi I am trying to write a bash script to add a line of text to the middle of a file. The way I worked it out was to calculate the number of lines and divide by 2. The file I am using is called newfile and it just contains lines of data. The new file I have created I have called midfile and... (7 Replies)
Discussion started by: BundBash
7 Replies

5. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

6. Shell Programming and Scripting

Adding text into file

Hello, I after some assistance please. Below is a file I need to read and for each line write an output. My input file looks like this 2 20008 2003-08-26 2 20032 2003-08-26 2 20041 2003-08-26 2 20037 2003-08-26 2 20050 2003-08-26 6 ... (6 Replies)
Discussion started by: giles.cardew
6 Replies

7. Shell Programming and Scripting

adding a line to a text file

I have a tab delimited text file, id name distance 1 3325167 0.334561754018 2 3290488 0.389444269458 3 3288794 0.392312701782 4 3347602 0.392532202097 5 3295355 0.394394169485 I need to add a line after the header line. The first and third field of... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

8. Windows & DOS: Issues & Discussions

Script for adding users to file permissions

I need a script to add the following two users ids to the permissions for various files: IIS_WPG and IUSR_CowGirl. I am fairly familiar with scripting but haven't been able to figure out how to do this via a script. Manually doing it is slow. I don't want to create users but only add them to a... (2 Replies)
Discussion started by: Stu Loventhal
2 Replies

9. Shell Programming and Scripting

Script for adding users to file permissions

I need a script to add the following two users ids to the permissions for various files: IIS_WPG and IUSR_CowGirl. I am fairly familiar with scripting but haven't been able to figure out how to do this via a script. Manually doing it is slow. I don't want to create users but only add them to a... (2 Replies)
Discussion started by: Stu Loventhal
2 Replies

10. Shell Programming and Scripting

Bash to select text and apply it to a selected file in bash

In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :) ... (4 Replies)
Discussion started by: cmccabe
4 Replies
BACULA-DIR(8)					       Network backup, recovery&verification					     BACULA-DIR(8)

NAME
bacula-dir - Bacula Director SYNOPSIS
bacula-dir [options] DESCRIPTION
This manual page documents briefly the bacula-dir command. Bacula's Director Daemon acts as the controller of the network backup system: it is responsible for scheduling and coordinating backups across the network. OPTIONS
-c file Specify the configuration file to use. -d nn Set debug level to nn. -dt Print timestamp in debug output. -f Run in foreground (for debugging). -g group Set the group/gid to run as. -m Print kaboom output (for debugging) -r job Run <job>. -s No signals (for debugging). -t Test the configuration file and report errors. -u user Set the username/uid to run as. -v Set verbose mode. -? Show version and usage of program. TCP-WRAPPERS CONFIGURATION Tcpwrappers looks for the service name of the bacula daemons in hosts.allow , and the service names of these daemons is configured to be different from the binary. The service names are configured to be %hostname%-%component% rather than bacula-dir (As defined in the bacula- dir.conf.in file) So the hosts.allow entry has to match %hostname%-%component% (servername-dir for example) instead of bacula-%component% WARNING: This means that if the hosts.allow file has the entry: bacula-dir: ALL you will not be able to run bconsole to connect to the local director! The entry would have to read: server-dir: ALL and this will allow the console to connect to the director. (The process running is bacula-dir.) SEE ALSO
bacula-fd(8), bacula-sd(8). AUTHOR
This manual page was written by Jose Luis Tallon <jltallon@adv-solutions.net>. Kern Sibbald 6 December 2009 BACULA-DIR(8)
All times are GMT -4. The time now is 08:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy