I need to execute scripts using SSH and Scripting. Each script is split into commands and executed individually, evaluating the output for each command. To identify the output, I use ReadUntilPrompt(). Before issuing any command, I call DetectPrompt() once.
However, some customer has a very dynamic prompt, containing some kind of counter, which makes ReadUntilPrompt() unreliable. After a lot of troubles I ended up simulating a constant prompt (a GUID) which is issued as an echo command after each proper command, and I read until this GUID is matched (ReadUntil(GUID)). This is less than satisfactory, but it works, provided my script builder does not switch the shell in his scripts to sqlplus, for example. This latter case should also be supported, but here end my ideas.
Example of a combined shell script:
echo Entering SQL scripting
sqlplus username/password@123.45.67.111:1521/SID123
select * from sales;
quit
echo Back again in the shell
Could you help me with some ideas/samples in this area? Thanks!