/*********************************************************************
* Author:samson
* date:04/18/2014
* Test Platform:
* Linux Ubuntu 3.2.0-58-generic-pae
* GNU Bash, version 4.2.39
* *******************************************************************/
#!/bin/bash
While read line
Do
#杀掉全部的python程序.
Killall Python2
#用读取到的行的參数作为输入运行 *******test.py python program, and the results are recorded in the line of the 110ut file, which is a row of the corresponding log file;
./*******test.py $line > {$line}11out &
Echo $line
Sleep 20s
#得到当前系统中的 the number of rows executed by the *******test.py program
wcret= ' ps aux | grep *******test.py | Wc-l '
#假设行数大于1, the program does not exit within 20 seconds and then runs for 5 minutes
if [$wcret-gt 1]; then
Sleep 5m
Fi
#运行5分钟后, kill all the Python2 programs.
Killall Python2
Sleep 5s
Done < $
The shell program reads the number of references in a file on a per-line basis and uses this parameter to run for 5 minutes each time