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