expect
让 Expect 代替我们与交互式程序进行交互:
#!/usr/tcl/bin/expect
set timeout 30
set host "101.200.241.109"
set username "root"
set password "123456"
spawn ssh $username@$host
expect "*password*" {send "$password\r"}
interact
EXPECT,Homepage
让 Expect 代替我们与交互式程序进行交互:
#!/usr/tcl/bin/expect
set timeout 30
set host "101.200.241.109"
set username "root"
set password "123456"
spawn ssh $username@$host
expect "*password*" {send "$password\r"}
interact
EXPECT,Homepage