Shell结合Expect实现自动输入密码
2017-05-01 13:19
603 查看
Shell结合Expect自动输入密码示例
#!/bin/bash cd /data/live /usr/bin/expect <<-EOF spawn git clone "ssh://xxxxxxxxxxxx" expect "*passphrase*" send "passwordhere\n" expect eof EOF time=`/bin/date "+%Y%m%d%H%M%S"` cd dir1 && tar czf /data/www/dir2_$time.tar.gz dir2 cd .. && rm -rf dir1 if [ $? -eq 0 ] then echo "Download here: http://10.13.38.22/dir2_"$time".tar.gz" else echo "Download Error!" fi
相关文章推荐
- Shell脚本中调用expect,实现自动输入密码的功能
- shell脚本通过expect脚本实现自动输入密码(使用expect)
- shell脚本通过expect脚本实现自动输入密码
- linux、mac上用expect脚本实现脚本自动输入密码
- linux、mac上用expect脚本实现脚本自动输入密码
- Shell脚本实现自动输入密码登录服务器
- 使用expect实现shell脚本中scp,ssh自动输入口令
- shell脚本从网络获取文件实现自动输入密码
- 用expect实现SCP/SSH自动输入密码登录
- expect实现scp ssh自动输入密码登录
- 用expect 实现切换用户时自动输入密码
- 用expect 实现切换用户时自动输入密码 (转载)
- 在shell脚本中用expect 实现 scp 文件的时候不手动输入密码
- expect实现自动输入密码
- 使用expect脚本实现Linux中自动输入密码
- 通过expect实现scp密码自动输入
- 在shell脚本中用expect 实现 scp 文件的时候不手动输入密码
- shell里expect自动输入密码
- Linux-----Shell脚本交互实现自动输入密码
- Shell脚本实现自动输入密码登录服务器