xref: /freebsd/bin/pkill/tests/pgrep-_p_test.sh (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
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