diff options
Diffstat (limited to 'tools/regression/usr.bin/pkill/pgrep-t.t')
-rw-r--r-- | tools/regression/usr.bin/pkill/pgrep-t.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/regression/usr.bin/pkill/pgrep-t.t b/tools/regression/usr.bin/pkill/pgrep-t.t new file mode 100644 index 0000000..7fb580d --- /dev/null +++ b/tools/regression/usr.bin/pkill/pgrep-t.t @@ -0,0 +1,25 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..1" + +name="pgrep -t <tty>" +tty=`ps -o tty -p $$ | tail -1` +if [ "$tty" = "??" ]; then + tty="-" +fi +sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 +ln -sf /bin/sleep $sleep +$sleep 5 & +sleep 0.3 +chpid=$! +pid=`pgrep -f -t $tty $sleep` +if [ "$pid" = "$chpid" ]; then + echo "ok - $name" +else + echo "not ok - $name" +fi +kill $chpid +rm -f $sleep |