Maybe you should push the command into the background (trailing '&' on the command, or whatever the remote system requires), so you can get back a prompt and close as you intend? Just a thought.
Hope that helps.
In reply to Re: net-ssh-expect is giving error
by atcroft
in thread net-ssh-expect is giving error
by james_culling
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |