Using read for input over ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using read for input over ssh
# 1  
Old 06-17-2015
Using read for input over ssh

Hi,

I'm using read in a script to prompt and receive input.

Code:
read -r -p "Do you also want to deploy folder? [y/N] " response

This works fine, however, if I remotely execute the same script via ssh, at this point in the code, I don't see the message at all, but it waits for input. I could echo the question first, is that the only option?

Thanks
# 2  
Old 06-17-2015
Try the -t option to ssh.
These 3 Users Gave Thanks to RudiC For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read input from Keyboard, do not proceed if no input

Hi, I am working on a script, which requests users to enter input. Ex: read -p "Please enter your email id:" email I don't want users skipping this entry, this has to be mandatory.I dont want to proceed without input. I can do a check if variable $email is empty and proceed if not.But, i... (7 Replies)
Discussion started by: aravindadla
7 Replies

2. Shell Programming and Scripting

Perl to read user input

I am creating a bash that uses perl . The below code closes before the input is entered. If I run the perl as a .pl it is fine. What am I doing wrong? Thank you :). #!/bin/bash cd 'C:\Users\cmccabe\Desktop\wget' wget -O getCSV.txt http://xxx.xx.xxx.xxx/data/getCSV.csv print... (4 Replies)
Discussion started by: cmccabe
4 Replies

3. UNIX for Dummies Questions & Answers

Input for read command

Hello, I want to use the read command in order to input a keyword from the keyboard. I then want to use this keyword in a grep command. How to I input a phrase as a keyword? For example if I use read keyword "today is" and then use grep, I get "No such file or directory" error. (6 Replies)
Discussion started by: FelipeAd
6 Replies

4. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

5. UNIX for Advanced & Expert Users

Input buffer and READ

Hello everyone, Can someone please explain the input buffer behaviour for the read command in ksh93 on AIX? I have 'googled' for weeks now, and did not find a satisfactory answer or solution to my dilemma. I have the following code: STTY=$(stty -g) if ;then stty -echo -icanon time 0 min... (1 Reply)
Discussion started by: gio001
1 Replies

6. Shell Programming and Scripting

Read Input and go BG

My script needs to get some input from the user and go as a background process and run. I have something like read input. do while ... if .. fi done can i use nohup inside the script?? (7 Replies)
Discussion started by: Antergen
7 Replies

7. Shell Programming and Scripting

Read input from another tty

Hello, I am trying to find out how I can find the tty number of a terminal a bash script has just created. Ultimately what I am trying to achieve is a script that starts a new terminal where stderr can be directed to. ls -l missing_file 2> /dev/pts/X To find the tty number of the... (3 Replies)
Discussion started by: colinireland
3 Replies

8. Shell Programming and Scripting

Help with Bash piped while-read and a read user input at the same time

Hi I am new to writing script and want to use a Bash Piped while-read and read from user input. if something happens on server.log then do while loop or if something happend on user input then do while loop. Pseudocode something like: tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Discussion started by: MyMorris
8 Replies

9. Shell Programming and Scripting

Read input

I have a script. #! /bin/bash echo "Enter a word: " read word echo $word That outputs like this.. Enter a word: hello hello But how can i read on the same line the question is printed? Like this.. Enter a word: hello hello (2 Replies)
Discussion started by: cbreiny
2 Replies

10. UNIX for Dummies Questions & Answers

read input file

echo "enter employee #:/c" read employee grep -w $employee /tmp/file.txt when it asked me employee #, i typed employee, worked fine. when it asked me employee #, i type ENTER, it just sit there. if someone type in NULL or ENTER key, i want to exit out. (2 Replies)
Discussion started by: tjmannonline
2 Replies
Login or Register to Ask a Question