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