写脚本的时候,经常需要用到超时控制.看<shell专家编程>时看到一个好例:修改了一下, 1.超过timeout时间还没执行完,则kill进程,发邮件告警: set-xmailSend(){ mailContent="xxxx Web response time over 5 seconds" echo $mailContent | mail -s "xxxxxx Web TimeOut"xxxxx@xxx.cion}time…
subprocess 模块 0 模块描述 / Module Description From subprocess module: """Subprocesses with accessible I/O streams This module allows you to spawn processes, connect to their input/output/error pipes, and obtain their return codes. For a complet…