Created
November 13, 2020 20:06
-
-
Save astr0n8t/148a3ef20c0beff292fa9e040062c867 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
#ECHO TESTING | |
echo " " | |
printf "\033[1;35mInput a number and press [ENTER] to kill that bash session and above (Up to 10)\033[0m\n" | |
printf "\033[1;32mINPUT: \033[0m" | |
read num | |
while true; do | |
for ((i=$num;i<10;i++)); do | |
if pgrep -t tty$i > /dev/null; then | |
var1=`pgrep -t tty$i` | |
kill -9 $var1 | |
printf "\033[1;31mKILLED\033[0m $var1 \n" | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment