Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

Recording user input from interactive shell script

Shell Programming and Scripting


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 04-30-2018   -   Original Discussion by shoutcast
shoutcast's Unix or Linux Image
shoutcast shoutcast is offline
Registered User
 
Join Date: Apr 2018
Last Activity: 30 April 2018, 1:03 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old Unix and Linux 04-30-2018   -   Original Discussion by shoutcast
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 22 June 2018, 3:55 PM EDT
Location: Aachen, Germany
Posts: 12,919
Thanks: 429
Thanked 3,968 Times in 3,649 Posts
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"?
Sponsored Links
    #3  
Old Unix and Linux 04-30-2018   -   Original Discussion by shoutcast
shoutcast's Unix or Linux Image
shoutcast shoutcast is offline
Registered User
 
Join Date: Apr 2018
Last Activity: 30 April 2018, 1:03 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by RudiC View Post
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 Unix and Linux 05-01-2018   -   Original Discussion by shoutcast
meirm's Unix or Linux Image
meirm meirm is offline
Registered User
 
Join Date: May 2018
Last Activity: 1 May 2018, 12:12 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
you can use script, from man script:

script - make typescript of terminal session
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script to accept user input on the fly Arun_Linux Shell Programming and Scripting 2 06-06-2013 10:44 AM
How to check the user input to be valid using shell script? hyeewang Shell Programming and Scripting 5 03-02-2013 09:28 AM
interactive scripts with user input that includes quotes donniemac Shell Programming and Scripting 1 10-17-2012 11:16 AM
User Input Shell Script sureshcisco Shell Programming and Scripting 3 07-29-2010 07:22 PM
How to hide user inputted text for interactive unix shell script? patrickpang Shell Programming and Scripting 1 04-04-2006 08:42 PM



All times are GMT -4. The time now is 08:23 PM.