-1
Remembering that this is not just for this case, I want to create for example . Bats to automate some things, so I would like to know how to make you wait for the return of commands and interpret my next line as response.
How can I make the file . bat answer a question comes from a command, for example:
I spin:
ssh -p port user@host
And then it asks for the password, as in the next line I do to answer it programmatically in the same . bat?
I tried to:
ssh -p port user@host
PASSWORD
But it doesn’t work, it discards my password and requires it on the next line.
I don’t know if my specific case doesn’t work, but when I run it, it makes a mistake:
Pseudo-terminal will not be allocated because stdin is not a terminal.
and then it goes like I’ve just run thessh -p port user @ host
– Woton Sampaio
I don’t know if it will work but try it -> echo PASSWORD | ssh -tt -p port user @host
– Solon Canto de Oliveira Neto