Created
October 13, 2017 09:49
-
-
Save cuiwm/35733238f0b94654e2e35fecb5a85816 to your computer and use it in GitHub Desktop.
iTerm2里面配置自动登录
This file contains 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 -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] | |
expect { | |
"(yes/no)?" | |
{send "yes\n";exp_continue} | |
"password:" | |
{send "[lindex $argv 3]\n"} | |
} | |
interact | |
#这里[lindex $argv 0], [lindex $argv 1], [lindex $argv 2], [lindex $argv 3] 分别代表着4个参数。 | |
#将这个文件 item2login.sh 复制到 /usr/local/bin 就可以了。 然后在iTerm2里面配置。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment