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