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