|
发表于 2007-6-12 09:05:43
|
显示全部楼层
可以用下面这个试一下:
#! /usr/bin/expect
spawn -noecho /bin/sh
expect -re "#|\\$" {
send "./xrgsu\r"
}
expect -re "*user name:" {
send "123456\r"
}
expect -re "*password:" {
send "123456\r\r\r\r"
}
基本上还是7楼的东西,只是看你的输出有很多无用信息,用 * 来匹配之 |
|