expect文档
https://linux.die.net/man/1/expect
tcl官网https://www.tcl-lang.org/
tcl的正则使用文档: https://www.tcl-lang.org/man/tcl8.6/TclCmd/regexp.htm
tcl的正则语法: https://www.tcl-lang.org/man/tcl8.6/TclCmd/re_syntax.htm
远程执行命令
exec_cmd() {
local ssh_ip="$1"
local user="$2"
local user_pwd="$3"
local root_pwd="$4"
local cmd="$5"
local sleep_time="$6"
if [ "X${sleep_time}" == "X" ]; then
sleep_