# This line cats the file created in the line above and says while
# catting the file, read each line.
cat /home/utility/bin/pid.txt | while read LINE
# This line tells the system to do a kill -9 on each PID that is
# listed in the pid.txt file. There will alwasy be an error message
# because the grep for the process is also listed but by the time
# the kill command is executed, the grep has already died.
do kill -9 $LINE
# This line closes up the do line.
done
The command syntax is:
scriptname.sh process_name
Check to make sure what your output is for ps -e and test!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.