xref: /freebsd/bin/pkill/tests/pgrep-v_test.sh (revision 02e9120893770924227138ba49df1edb3896112a)
1#!/bin/sh
2
3base=`basename $0`
4
5echo "1..2"
6
7name="pgrep -v"
8sleep=$(pwd)/sleep.txt
9ln -sf /bin/sleep $sleep
10$sleep 5 &
11sleep 0.3
12pid=$!
13if [ -z "`pgrep -f -v $sleep | egrep '^'"$pid"'$'`" ]; then
14	echo "ok 1 - $name"
15else
16	echo "not ok 1 - $name"
17fi
18if [ ! -z "`pgrep -f -v -x x | egrep '^'"$pid"'$'`" ]; then
19	echo "ok 2 - $name"
20else
21	echo "not ok 2 - $name"
22fi
23kill $pid
24rm -f $sleep
25