且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在使用期望“发送"的同时将输出存储在变量中.命令.

更新时间:2023-01-16 07:44:20

2}''
将会返回类似
的内容
19768
19546
10465

2.我想在pf Expect的帮助下做同样的事情,这是我的代码
2}''
which will return something like

19768
19546
10465

2. same thing i want to do with the help pf expect , here is my code
proc monitor_server {ip_server} {
	source "/cygdrive/e/ncp/pat/pat_config.exp"
	set cmd1 {ps -aef | grep reflect | grep -v grep | awk ''{print


2}''} 如果{[catch {spawn ssh
2}''} if {[catch { spawn ssh


ip_server -l root} res]} { 放置
ip_server -l root } res]} { puts