I need to respond to a prompt generated by a command, for example ssh hostnamethen a password prompt appears and the script must automatically enter the password after the prompt.I tried using read but it did not work. I did it in shell easily but in exec, it is a challenge
How to respond in a prompt using exec channel of JSch
ksh;exec
channel.setPty(true) did the trick