I have a .dat file named test.dat where I have stored some process IDs.
Now I need to pick a process ID, one by one and then fire kill -9 for each of those. The logic should be:
open file <filename.dat>
read until last line of file
if process ID is found fire kill -9 <process ID>
Can anyone help me out with the Unix script for this?