【Shell】EOF 解决shell 交互

脚本

#!/bin/bash

/usr/bin/expect <<EOF

#使用root权限来执行命令
spawn ssh ljj@localhost
expect "password"
send "qqq123...A\r"
expect eof

EOF

前提下载 

yum install expect

posted @ 2020-05-18 15:12  阿里云的奥斯卡  阅读(415)  评论(0)    收藏  举报