xref: /freebsd/bin/pkill/tests/pkill-g_test.sh (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1#!/bin/sh
2
3base=`basename $0`
4
5echo "1..2"
6
7name="pkill -g <pgrp>"
8pgrp=`ps -o tpgid -p $$ | tail -1`
9sleep=$(pwd)/sleep.txt
10ln -sf /bin/sleep $sleep
11$sleep 5 &
12sleep 0.3
13pkill -f -g $pgrp $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 0"
26sleep=$(pwd)/sleep.txt
27ln -sf /bin/sleep $sleep
28$sleep 5 &
29sleep 0.3
30pkill -f -g 0 $sleep
31ec=$?
32case $ec in
330)
34	echo "ok 2 - $name"
35	;;
36*)
37	echo "not ok 2 - $name"
38	;;
39esac
40rm -f $sleep
41