Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@rhel9 bash-scripting]# cat killthezombies.sh
- #!/bin/bash
- if [ -z $1 ]
- then
- echo provide the name of the zombie to kill when running this script
- exit 11
- fi
- ZOMBIES=$(ps aux | grep $1 | grep -v grep | awk '{ print $2 }')
- echo DEBUG: zombies is $ZOMBIES
- echo press Enter to continue
- read
- if [ -z $ZOMBIES ]
- then
- echo no work to do
- exit 12
- fi
- kill -9 $ZOMBIES
- echo the zombies are now gone
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement