Deleted Added
full compact
pgrep-F_test.sh (149472) pgrep-F_test.sh (263351)
1#!/bin/sh
1#!/bin/sh
2# $FreeBSD: head/tools/regression/usr.bin/pkill/pgrep-F.t 149472 2005-08-25 20:11:39Z pjd $
2# $FreeBSD: head/bin/pkill/tests/pgrep-F_test.sh 263351 2014-03-19 12:46:04Z jmmv $
3
4base=`basename $0`
5
6echo "1..1"
7
8name="pgrep -F <pidfile>"
3
4base=`basename $0`
5
6echo "1..1"
7
8name="pgrep -F <pidfile>"
9pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1
10sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
9pidfile=$(pwd)/pidfile.txt
10sleep=$(pwd)/sleep.txt
11ln -sf /bin/sleep $sleep
12$sleep 5 &
13sleep 0.3
14chpid=$!
15echo $chpid > $pidfile
16pid=`pgrep -f -F $pidfile $sleep`
17if [ "$pid" = "$chpid" ]; then
18 echo "ok - $name"
19else
20 echo "not ok - $name"
21fi
22kill "$chpid"
23rm -f $pidfile
24rm -f $sleep
11ln -sf /bin/sleep $sleep
12$sleep 5 &
13sleep 0.3
14chpid=$!
15echo $chpid > $pidfile
16pid=`pgrep -f -F $pidfile $sleep`
17if [ "$pid" = "$chpid" ]; then
18 echo "ok - $name"
19else
20 echo "not ok - $name"
21fi
22kill "$chpid"
23rm -f $pidfile
24rm -f $sleep