Hi,
thanks for the code.. this is a simpler solution.
I wanted to specifically use Expect so i tried the code I had sent. I found the problem with that though.. Expect was returning extra control characters in the returned output so pattern matching was failing.. The solution was to 'extract the required pattern from the output//
but will check the openSSH to see if it can make my whole framework simpler..
many thanks..