I'm new to Java, I was looking for a solution to execute specific commands Using ProcessBuilder. I have tried multiple approaches but in all, commands are executing in one go. For eg.
ProcessBuilder pb= new ProcessBuilder("plink","-ssh","username@XX.XX.XX.XX");
Process p=pb.start();
After this i am able to read output of command too (Which is asking for password), which i am unable to provide by any approach.
Basically i want to execute commands based on output of previous command in same Process/ProcessBuilder.
Thanks in advance.