Scripting for inline input


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripting for inline input
# 1  
Old 03-23-2010
Scripting for inline input

Hello,
I'm not much familiar with scripting, just a little bit. Maybe someone could give an advice how implement my task. It might be in shell or perl.
I have linux system where I install Kerberos. Now I have to add user. It's done like this from prompt: 1. run kadmin.local 2. it switches to admin prompt and then I have to run addprinc <user_name>. This brings me to the next line which ask me to provide password , after that it requests me to provide password one more time. That's the procedure and it works for me fine. The issue is that I have to add 1000 users. They will be like user1, user2 ... user1000 and have the same password. So my goal is to write a script which will run a loop with 1000 iteration, increase username by one and feed password 2 times.
Could someone help me how to write this kind of script? My main confusion is how to feed the line with the password.
Thanks in advance.
# 2  
Old 03-24-2010
You may want to have a look at "Expect" to automate your task. Check the man page on your system for a good introduction. Also, if you google "expect nist", the first link takes you to the Expect homepage that has a wealth of information and a very good FAQ section as well.

tyler_durden
This User Gave Thanks to durden_tyler For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX Scripting help to input string and search a file to find

Hi Don, this is not homework question. I work for a Credit card company and my development goal this year is to learn Unix. I would love if others can help me get started, thanks. Hi everyone I am new to Unix and need help writing a script that can ask user for an input, then search that input... (2 Replies)
Discussion started by: 12ic11
2 Replies

2. Shell Programming and Scripting

UNIX Scripting help to input string and search a file to find

Hi everyone, I am new to Unix and need help writing a script that can ask user for an input, then search that input within a file I know will have to use the read and grep commands, anyone can give me somewhere to start would help Task: Write a script to display which volume pool a given... (1 Reply)
Discussion started by: 12ic11
1 Replies

3. UNIX for Dummies Questions & Answers

UNIX Scripting help to input string and search a file to find

Hi everyone, I am new to Unix and need help writing a script that can ask user for an input, then search that input within a file I know will have to use the read and grep commands, anyone can give me somewhere to start would help Task: Write a script to display... (1 Reply)
Discussion started by: 12ic11
1 Replies

4. Shell Programming and Scripting

How to process multiple input files using Shell scripting

Hi, I would like to write a for loop that does the following: I have a file called X.txt and other files called 1.txt,2.txt, .....,1000.txt. I want to substitute the 6th column of the file X.txt with 1.txt and store the output as X.1. Then I want to do the same with X.txt and 2.txt and store... (0 Replies)
Discussion started by: evelibertine
0 Replies

5. Shell Programming and Scripting

Unix Shell scripting -How to skip User Standard input section from another script

All, problem Description: For example: I have two shell scripts(executables). let name it as script1 and script2.I'm trying to execute script1 from script2. while executing script2, script1 is asking for manual input(input from keyboard). Now i need to know how I can skip this user input... (3 Replies)
Discussion started by: techie99
3 Replies

6. Homework & Coursework Questions

[Scripting]Find & replace using user input then replacing text after

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: (o) Checkout an auto part: should prompt the user for the name of the auto part and borrower's name: Name:... (2 Replies)
Discussion started by: SlapnutsGT
2 Replies

7. UNIX for Dummies Questions & Answers

Unix Shell Scripting -- update employees not present in input file

ALL, My shell script takes a employee file as input. I have to identify the list of employees not in the input file and update their status in the database. Approach I followed: by traversing through the input file add all the emplid's to a variable. update the status of employees not in... (2 Replies)
Discussion started by: sailussr
2 Replies
Login or Register to Ask a Question