关于expect shell 与rsh
Quote: 引用:expect中是不一样的,参考例子:主要是set results $expect_out(buffer) # Send the prebuilt command, and then wait for another shell prompt. send "$my_command\r" expect "%" # Capture the results of the command into a variable. This can be displayed, or written to disk. set results $expect_out(buffer)我把rhs那一行改成了 let temp [spawn rsh 192.168.152.$ip -l hadoop hostname],结果效果仍然是temp获得的似乎是spawn的进程号码。有其他的办法吗?这个rsh是怎么回事啊?循环重定向就不管用了?
expect中是不一样的,参考例子:主要是set results $expect_out(buffer) # Send the prebuilt command, and then wait for another shell prompt. send "$my_command\r" expect "%" # Capture the results of the command into a variable. This can be displayed, or written to disk. set results $expect_out(buffer)
# Send the prebuilt command, and then wait for another shell prompt. send "$my_command\r" expect "%" # Capture the results of the command into a variable. This can be displayed, or written to disk. set results $expect_out(buffer)