- 论坛徽章:
- 0
|
我们学校用的是瑞捷,不想每次都手动联接,所以下载了expect-5.42 expect-devel-5.42 tcl-8.4安装后,编写了一个脚本,如下:
#! /usr/bin/expect
#supplicant
spawn xrgsu -a
expect "Please input your user name:"
send "120592004009\r"
expect "Please input your password:"
send "lijing\r"
expect "Use DHCP,1-Use,0-UnUse(Default: 0):"
send "\r"
expect "Use default auth parameter,0-Use 1-UnUse(Default: 0):"
send "\r"
expect "LogOff:"
sleep 1000
#end
在终端用sh auto-connect.sh运行出现错误如下:
auto-connect.sh: line 3: spawn: command not found
couldn't read file "Please input your user name:": no such file or directory
auto-connect.sh: line 5: send: command not found
couldn't read file "Please input your password:": no such file or directory
auto-connect.sh: line 7: send: command not found
couldn't read file "Use DHCP,1-Use,0-UnUse(Default: 0):": no such file or directory
auto-connect.sh: line 9: send: command not found
couldn't read file "Use default auth parameter,0-Use 1-UnUse(Default: 0):": no such file or directory
auto-connect.sh: line 11: send: command not found
couldn't read file "LogOff:": no such file or directory
我的内核是2.6.11,请高手们指教,万分感谢! |
|