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