I have a short bash script to check to see if a Python program is running. The program writes out a PID file when it runs, so comparing this to the current list of running p
Commands after a pipe | are run in a subshell. Changes to variable values in a subshell do not propagate to the parent shell.
|
Solution: change your loop to
while read PID; do # ... done < $PIDFILE