1#!/bin/sh 2# $FreeBSD$ 3 4base=`basename $0` 5 6echo "1..1" 7 8name="pgrep -P <ppid>" 9ppid=$$ 10sleep=$(pwd)/sleep.txt 11ln -sf /bin/sleep $sleep 12$sleep 5 & 13sleep 0.3 14chpid=$! 15pid=`pgrep -f -P $ppid $sleep` 16if [ "$pid" = "$chpid" ]; then 17 echo "ok - $name" 18else 19 echo "not ok - $name" 20fi 21kill $chpid 22rm -f $sleep 23