So I have a .txt file which contains a list of PIDs and I want to write a shell script to check which of those PIDs are active.
My File.txt looks like-
10414
10491
10632
10636
10623
10639
I want to read the file line by line and check if that particular PID is active or not and if not then remove only that PID from the file.