I was thinking I could put this in a for loop like so.
for 1 2 3 4 in $(cat outfile)
do
echo $4
done
Since there are spaces between each value in each line that would set the value in the first column for line 1 to $1 and would set the value in the 2nd column for line 1 to #2 and so on. Then I could check $4 for a certain value and if true then the next step would be to kill the process which would be in $2.
Please don't laugh. I somehow think I remember doing something like this but can't find the freaking code in another script.
So if I didn't do a good job of explaining above I basically want to take the value in 4th column and if it's above a certain number run a kill against the PID which is the value in column #2.
for the below code, it will check whether the 4th column is greater than 50. If it is, then it will issue a kill command for the processid (2nd column)
i included echo in the below code, just exeucte it and check whether it gives the correct output (as u expect). If yes, then remove the echo part.
Maybe that's not big to everyone but it's hugh to me. Thank you very much. I dream of the day I have the "knowledge" power. I appreciate your quick response.
It did work as expected but if you have time would you consider adjusting to check for the 7th column (70:24) and if it is above 05:00 then kill the processid? Meaning if the value in column 4 and the value in column 7 are both true then kill the processid.