i was looking at the solution of Run cron job only if it isn't already running in order to apply it to a similar problem that I have but I cannot understand the
ps -u $USER -f | grep "[ ]$(cat ${PIDFILE})[ ]"'
It appears to be saying check the end of each line from ps for ' PIDnumber ' but when I look at my ps output the PIDnumber is in column two. I am interpreting the first $ as the regular expression check_end_of_line option.