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

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 echo ing 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.

script - make typescript of terminal session