Here is what I want to do in java:
- Open an ssh session ( remote or local).
- Send commands ( this is just an example):
- cleartool lsview
- cleartool setview
- cleartool catcs
For ssh connection there seems to be a number of ssh libraries (I am only lookin' for open source). But the problem seems to be how we can send commands and check the execution state for each one before sending another one. I have seen solutions where they open a shell and then sends each command and checks if the shell prompt returns. Problem I have faced is that most servers have different prompts (and we do not have control of it) and sometimes the prompt changes (scripts do sourcing).
Are there any solutions out there on how to solve this problem?