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