The following are the functions of /etc/init.d/functions on RHEL. I am trying to understand what the __pids_var_run()
function __pids_var_run()
when I come across this while loop.
while : ; do read line [ -z "$line" ] && break for p in $line ; do if [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] ; then if [ -n "$binary" ] ; then local b=$(readlink /proc/$p/exe | sed -e 's/\s*(deleted)$//') [ "$b" != "$binary" ] && continue fi pid="$pid $p" fi done done < "$pid_file"
Can someone explain what while : ; do ; ... done < "$pid_file"
does while : ; do ; ... done < "$pid_file"
while : ; do ; ... done < "$pid_file"
while : ; do ; ... done < "$pid_file"
? More specifically, the last part after done
, since the rest of it more or less makes sense.
source share