Recording user input from interactive shell script

Tags
shell scripts

 
Thread Tools Search this Thread
# 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

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Linux Console for Interactive Input Script alvinoo UNIX for Beginners Questions & Answers 4 05-05-2016 12:43 PM
How to set a non-login non-interactive shell for a user? me_me_me Homework & Coursework Questions 4 12-29-2014 06:28 PM
Recording / Monitoring Shell Script Resource Usage. vaibhavvsk Infrastructure Monitoring 0 08-18-2014 06:44 AM
Shell script to accept user input on the fly Arun_Linux Shell Programming and Scripting 2 06-06-2013 11:44 AM
How to check the user input to be valid using shell script? hyeewang Shell Programming and Scripting 5 03-02-2013 10:28 AM
interactive scripts with user input that includes quotes donniemac Shell Programming and Scripting 1 10-17-2012 12:16 PM
create an array which can store the strings from the user input in shell script Pkast Shell Programming and Scripting 1 10-08-2012 11:08 AM
Interactive script to give user option of what text to add marcozd Shell Programming and Scripting 2 05-18-2011 04:15 PM
User Input Shell Script sureshcisco Shell Programming and Scripting 3 07-29-2010 08:22 PM
Unix Shell scripting -How to skip User Standard input section from another script techie99 Shell Programming and Scripting 3 07-14-2010 08:29 AM
SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script little_wonder Shell Programming and Scripting 4 03-04-2010 03:07 AM
Help with Interactive / Non Interactive Shell script rits Homework & Coursework Questions 1 08-16-2009 05:39 PM
put an interactive script in background after taking input epsilonaurigae Shell Programming and Scripting 7 02-15-2008 10:18 PM
Q: Recording shell script screen output using "script" command ? lalfonso.gomez Shell Programming and Scripting 4 01-18-2007 09:31 PM
How to hide user inputted text for interactive unix shell script? patrickpang Shell Programming and Scripting 1 04-04-2006 09:42 PM