Expect

确认crontab内容

#!/usr/bin/expect 
#ver 0.2 by zhou 
set hostname [lindex $argv 0] 
send_user "\n\n<--------------  check $hostname START -------------->\n\n" 
spawn ssh $hostname 
expect "*~]$" 
send "su -\r" 
expect "Password:" 
send "password\r" 
expect "*~]#" 
send "crontab -l\r" 
expect "*~]#" 
send_user "\n\n<--------------  check $hostname END -------------->\n\n" 
expect eof 
close 
exit
/home/yepnnet/public_html/wiki/data/pages/expect.txt · 最后更改: 2010/02/08 21:21 由 admin
到顶部
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0