OpenVMS no prompt returning in output (wodSSH / wodSSH.NET)
Hi,
I am currently trying to run some commands on our OpenVMS servers. The code I am executing is below.
[code]
_sshConnection.Send( show queue /BRIEF & vbCrLf)
Do
output_data.Append(_sshConnection.Receive)
Loop While Not output_data.ToString.EndsWith( $ )
[/code]
This command lists all the batch queues with the follwoing output
batch queue .....
batch queue .....
batch queue .....
batch queue .....
I am looping until I find the prompt again and then will exit the loop. The problem is that the output doesnt recieve the prompt at the end and so it just loops forever!!
Is there any reason why the prompt isnt in the output when the command completes?
Re: OpenVMS no prompt returning in output
Hi,
Why don't you catch prompt and output using WaitFor Method?
Something like this without using loop:
[code]_sshConnection.Send( show queue /BRIEF & vbCrLf)
Debug.Print _sshConnection.WaitFor( $ )[/code]
or this:
[code]_sshConnection.Send( show queue /BRIEF & vbCrLf)
Debug.Print _sshConnection.WaitFor( regex:[\$ #>] $ )[/code]
More help for Waitfor Method you can find here:
http://www.weonlydo.com/SSH.NET/Help/WeOnlyDo.Client.SSH.WaitFor_overload_2.html
Let us know how it goes.
Regards,
Drazen