xref: /freebsd/bin/pkill/tests/pkill-_g_test.sh (revision e1e636193db45630c7881246d25902e57c43d24e)
1#!/bin/sh
2
3base=`basename $0`
4
5echo "1..2"
6
7name="pkill -G <gid>"
8rgid=`id -gr`
9sleep=$(pwd)/sleep.txt
10ln -sf /bin/sleep $sleep
11$sleep 5 &
12sleep 0.3
13pkill -f -G $rgid $sleep
14ec=$?
15case $ec in
160)
17	echo "ok 1 - $name"
18	;;
19*)
20	echo "not ok 1 - $name"
21	;;
22esac
23rm -f $sleep
24
25name="pkill -G <group>"
26rgid=`id -grn`
27sleep=$(pwd)/sleep.txt
28ln -sf /bin/sleep $sleep
29$sleep 5 &
30sleep 0.3
31pkill -f -G $rgid $sleep
32ec=$?
33case $ec in
340)
35	echo "ok 2 - $name"
36	;;
37*)
38	echo "not ok 2 - $name"
39	;;
40esac
41rm -f $sleep
42