linuxexpect實現自動登錄腳本
linuxexpect實現自動登錄腳本
;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。
導讀 ;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。
![](https://img.51dongshi.com/20250104/wz/18542806352.jpg)
系統大全為您提供?1)安裝expect[root@server?~]#?yum?install?-y?expect2)編寫腳本#!/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"?rootexpect?{"*Password:"?{send?"XXXXXX"}}interact#!/bin#created?by?mis_yw?2013-11-30#verify?virus.file=$1if?[[?!?-e?$file?]]?;then#echo?"$file?is?not?exsit."echo?noexit?0fiinfected=`.erifyvirus?$file?|?grep?Infected?|?grep?0`if(($?))?;thenecho?yeselseecho?nofi???以上就是系統大全給大家介紹的如何使的方法都有一定的了解了吧,好了,如果大家還想了解更多的資訊,那就趕緊點擊系統大全官網吧。??本文來自系統大全http:///如需轉載請注明!推薦:win7純凈版
linuxexpect實現自動登錄腳本
;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。
為你推薦