linux expect实现自动登录脚本

系统教程导读

收集整理了【linux expect实现自动登录脚本】操作系统教程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含694字,纯文字阅读大概需要1分钟

系统教程内容图文

【 1)安装expect
[root@server ~]# yum install -y expect
2)编写脚本
#!/usr/bin/expect -f
#created by mis_yw 2013-11-30
#verify virus by system user oa
#set password [1index $argv 0 ]
#set timeout 10.
set file [ lindex $argv 0 ]
spawn su -c “/optsperskyv4fs/binv4fs-control –scan-file $file” root
expect {
“*Password:” {send “XXXXXX “}
}
interact
#!/bin
#created by mis_yw 2013-11-30
#verify virus.
file=$1
if [[ ! -e $file ]] ;then
#echo “$file is not exsit.”
echo no
exit 0
fi
infected=`.erifyvirus $file | grep Infected | grep 0`
if(($?)) ;then
echo yes
else
echo no】
【 fi
 

  以上就是给大家介绍的如何使的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击官网吧。 
 
本文来自http://www.win7cn.com/如需转载请注明!推荐:win7纯净版】

系统教程总结

以上是为您收集整理的【linux expect实现自动登录脚本】操作系统教程的全部内容,希望文章能够帮你了解操作系统教程linux expect实现自动登录脚本
如果觉得操作系统教程内容还不错,欢迎将网站推荐给好友。

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » linux expect实现自动登录脚本