Created
May 10, 2020 12:27
-
-
Save petersg83/3ec36bf00580654e4a3a1bb6f03c0554 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in `ls *.py` | |
do | |
echo "---> $f" | |
python3 $f > /dev/null & | |
sleep 1 | |
program=`ps -ef | grep "ython $f" | awk '{print $2}'` | |
pid=(${program}) | |
pid=${pid[0]} | |
if (($pid > 0)) | |
then | |
kill $pid > /dev/null 2>&1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment