Missing read prompt in bash when using ssh?

Please tell me that I am missing something really obvious here:

$ cat ~/bashplay/f #!/bin/bash read -p 'RDY> ' x echo $x $ ~/bashplay/f RDY> direct execution direct execution $ ssh somehost ~/bashplay/f indirect via ssh indirect via ssh 

Note the missing "RDY>" hint when using ssh. I see the same thing in python when using the "readline" package. Does anyone know why?

+4
source share
1 answer

From man bash :

-p prompt
Display a standard error prompt before attempting to read any input. The invitation is displayed only if the input comes from the terminal.

Use the ssh -t option, which forces pseudo-tty to be highlighted:

 ssh -t somehost ~/bashplay/f 
+5
source

Source: https://habr.com/ru/post/1312486/


All Articles