Below is a sample snippet, normally it works fine unless we passes some command which shutdown the server or cause a disconnection .
To handle this, is it possible to expect either "#" or eof after sending the cmd .
send "${_cmd_}\r"
expect "#"
send "exit\r"