Skip to content

Instantly share code, notes, and snippets.

@hjzheng
Created October 23, 2015 02:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hjzheng/382a06d3b1b19532a264 to your computer and use it in GitHub Desktop.
Save hjzheng/382a06d3b1b19532a264 to your computer and use it in GitHub Desktop.
用于iTerm2的自动登录脚本
#!/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