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