Created
October 23, 2015 02:41
-
-
Save hjzheng/382a06d3b1b19532a264 to your computer and use it in GitHub Desktop.
用于iTerm2的自动登录脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set timeout 30 | |
spawn ssh [lindex $argv 0]@[lindex $argv 1] | |
expect { | |
"(yes/no)?" | |
{send "yes\n";exp_continue} | |
"password:" | |
{send "[lindex $argv 2]\n"} | |
} | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment