标签:rac com www send expect shel and ora 一个
找一个目录创建一个普通的文件,例如 vi myprofile ,编辑以下内容
#!/usr/bin/expect
set PORT 22
set HOST www.****.com(或者ip地址)
set USER bob
set PASSWORD 123456
spawn ssh -p $PORT $USER@$HOST
expect {
"yes/no" { send "yes/y";exp_continue; }
"*password:*" { send "$PASSWORD\r" }
}
interact
选择 Profiles -> openProFiles(或者快捷键?+o),选中Edit Profile...
点击+号添加,选择command 填入 expect 加你刚才建的文件路径!/usr/bin/expect
set PORT 22
set HOST www.****.com(或者ip地址)
set USER bob
set PASSWORD 123456
spawn ssh -p $PORT $USER@$HOST
expect {
"yes/no" { send "yes/y";exp_continue; }
"password:" { send "$PASSWORD\r" }
}
interact
下次就可以直接选这个profile启动了
标签:rac com www send expect shel and ora 一个
原文地址:https://www.cnblogs.com/rainymemory/p/12404209.html