1
0

feat: Initial commit

This commit is contained in:
2024-03-22 16:54:05 +01:00
parent 0d9957a125
commit d993185b89
25 changed files with 641 additions and 0 deletions

22
Lab07/es5.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
finds=0
while :
do
line=$(ps -el | tr -s " " | cut -d " " -f 2,4,14 | grep $1 | cut -d " " -f 1,2)
if [[ $(echo $line | cut -d " " -f 1) = "Z" ]]
then
let finds++
if [[ $finds -ge 5 ]]; then
pid=$(echo $line | cut -d " " -f 2)
kill -9 $pid
echo "Killed process $pid"
exit 0
fi
elif [[ $finds -ne 0 ]]
then
finds=0
fi
sleep $2
done