4 base=$(dirname $(realpath "$0"))
13 while [ ! -f ${flagfile} ] && [ ${iter} -lt 50 ]; do
18 if [ ! -f ${flagfile} ]; then
23 sentinel="findme=test-$$"
24 sentinelsz=$(printf "${sentinel}" | wc -c | tr -d '[[:space:]]')
26 spin="${base}/spin_helper"
27 flagfile="pgrep_f_short.flag"
29 ${spin} --short ${flagfile} ${sentinel} &
31 if ! waitfor ${flagfile}; then
34 pid=$(pgrep -f ${sentinel})
35 if [ "$pid" = "$chpid" ]; then
43 name="pgrep -f long args"
44 flagfile="pgrep_f_long.flag"
45 ${spin} --long ${flagfile} ${sentinel} &
47 if ! waitfor ${flagfile}; then
50 pid=$(pgrep -f ${sentinel})
51 if [ "$pid" = "$chpid" ]; then