I wrote a bash script that at one point automates the installation of some software on a remote host, like so:
ssh user@remotehost "<path>/install-script"
Where install-script
is a bash script. That bash script at some point calls another bash script, which at some point calls an interactive python script, which then uses python's raw_input()
function to gather user input.
When I run the install script normally (from a bash shell), it prompts for and accepts input perfectly fine. However, when the above piece of code from my script runs, I get no prompt until after I type the input.
The only script I really have control over is my automation script.
I have read this question: "Python - how can I read stdin from shell, and send stdout to shell and file." However, I have no problem running in a normal bash shell, only via a remote command over ssh.
Can this issue be fixed from within my script (and if so, how?), or would I have to modify the python script?
UPDATE
To clarify, the input prompts I am referring to are the prompts from the python script. I am not entering a password for ssh (the remote host has my public key in it's authorized_keys
file).
UPDATE
For further clarification, my script (bash) is calling the install script (bash) that calls another bash script that finally calls the python script, which prompts for user input.
i.e. bash -> bash -> bash -> python