xref: /freebsd/bin/pkill/tests/pkill-x_test.sh (revision edf8578117e8844e02c0121147f45e4609b30680)
1#!/bin/sh
2
3base=`basename $0`
4
5echo "1..4"
6
7name="pkill -x"
8sleep=$(pwd)/sleep.txt
9ln -sf /bin/sleep $sleep
10$sleep 5 &
11sleep 0.3
12pkill -x slee -P $$
13if [ $? -ne 0 ]; then
14	echo "ok 1 - $name"
15else
16	echo "not ok 1 - $name"
17fi
18pkill -x sleep -P $$
19if [ $? -eq 0 ]; then
20	echo "ok 2 - $name"
21else
22	echo "not ok 2 - $name"
23fi
24rm -f $sleep
25
26name="pkill -x -f"
27sleep=$(pwd)/sleep.txt
28ln -sf /bin/sleep $sleep
29$sleep 5 &
30sleep 0.3
31pkill -x -f "$sleep " -P $$
32if [ $? -ne 0 ]; then
33	echo "ok 3 - $name"
34else
35	echo "not ok 3 - $name"
36fi
37pkill -x -f "$sleep 5" -P $$
38if [ $? -eq 0 ]; then
39	echo "ok 4 - $name"
40else
41	echo "not ok 4 - $name"
42fi
43rm -f $sleep
44