Recording user input from interactive shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Recording user input from interactive shell script
# 1  
Old 04-30-2018
Recording user input from interactive shell script

Hello, I want to start out by saying that I am fairly new to scripting and am looking for someone that can point me in the right direction.

Basically what I need is a way to run a interactive script that will prompt users with questions weather that be yes/no or a specific answer.. I want to be able to record the users input into a answer file so I can run the script unattended on another server.. I have searched and searched but I can't seem to find anything on the subject.. Is it possible? Can maybe some point me in the right direction.

Any help would be appreciated\

thanks

Steven
# 2  
Old 04-30-2018
Welcome to the forum.

Your request is somewhat ambiguous. Try to be more specific, with code and data samples (both in "code tags"). Do you
- want to log the interactive answers? What keeps you from echoing them to a log file?
- want to read answers from a previously created file? Did you consider "input redirection"?
# 3  
Old 04-30-2018
Quote:
Originally Posted by RudiC
Welcome to the forum.

Your request is somewhat ambiguous. Try to be more specific, with code and data samples (both in "code tags"). Do you
- want to log the interactive answers? What keeps you from echoing them to a log file?
- want to read answers from a previously created file? Did you consider "input redirection"?
Ok, sorry, so basically I want to write a shell script that will ask you what script you want to run and then it will run script and record the users answer in a answer file and then use pssh to push the script and answer file to a bunch of servers and run it with the answer file.. I don't have any code yet cause I can't seem to get past the first part of the new script.. So the reason I can't use echo is cause the idea is the script I am writing should be able to run any script and record the answers and push the script and answers to the remote server.. So I can't alter the other scripts. I can't figure out how to use one script to run another script and record the answers.
# 4  
Old 05-01-2018
you can use script, from man script:

script - make typescript of terminal session
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux Console for Interactive Input Script

Hi there, How do I enter command to the interactive console. I was able to do it via the first line. What if I have more lines to input into the interactive console from line 3 onwards. Is there a more easier way? (echo -e "load openvas" ; echo -e "openvas_help") | msfconsole ... (4 Replies)
Discussion started by: alvinoo
4 Replies

2. Shell Programming and Scripting

Shell script to accept user input on the fly

I want a shell script that accepts user input simultaneously when performing other tasks. Example: A shell script should echo some messages on the console and when the user presses some keys it should respond to that action. say, when user presses the key A - more information should be printed... (2 Replies)
Discussion started by: Arun_Linux
2 Replies

3. Shell Programming and Scripting

How to check the user input to be valid using shell script?

How to check the user input to be valid using shell script? The valid input is in the format like as follows. 1. It can only have r,w,x or a hyphen and nothing else. 2. ensure the r, w, x are in the correct order. for example: rwxr-xr-x is a valid format. Thanks (5 Replies)
Discussion started by: hyeewang
5 Replies

4. Shell Programming and Scripting

interactive scripts with user input that includes quotes

I'm writing a basic ldapsearch script that prompts the user for their search criteria. The input they're being asked for is the search filter portion of the ldapsearch command. This string must be quoted. When the script executes the command it returns nothing. If I hard code a search filter it... (1 Reply)
Discussion started by: donniemac
1 Replies

5. Shell Programming and Scripting

create an array which can store the strings from the user input in shell script

I want to create an array which can store the strings from the user input in shell script . example :- I want to store the 5 fruits name in a single array which the user provides . (1 Reply)
Discussion started by: Pkast
1 Replies

6. Shell Programming and Scripting

User Input Shell Script

Hello I am trying to create a user input shell scipt. The objective is user should enter the circuit number and the input is saved in a log file. If the user does not enter anything then the question should prompt it until the circuit no. is entered. Can any one please correct the code below.... (3 Replies)
Discussion started by: sureshcisco
3 Replies

7. Shell Programming and Scripting

SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script

Dear All, The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script. Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt. Please fins the below sample script which i tried. SCRIPT: -------- #!... (4 Replies)
Discussion started by: little_wonder
4 Replies

8. Homework & Coursework Questions

Help with Interactive / Non Interactive Shell script

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (1 Reply)
Discussion started by: rits
1 Replies

9. Shell Programming and Scripting

put an interactive script in background after taking input

i am trying to find a way to put an interactive script in the background after taking input from the user a few test lines i was trying: date echo "Enter location" LOCATION= read LOCATION sleep 100 sleep 200 date for this small example i want the script to as the user for the... (7 Replies)
Discussion started by: epsilonaurigae
7 Replies

10. Shell Programming and Scripting

How to hide user inputted text for interactive unix shell script?

Hi everybody, Do you know how to hide the text for interactive unix shell script? Just like the case for inputting password during logon. Patrick (1 Reply)
Discussion started by: patrickpang
1 Replies
Login or Register to Ask a Question