11.8Schristos# $NetBSD: kill,v 1.8 2016/02/29 23:50:59 christos Exp $ 21.4Sjtc# Copyright (c) 1991, 1993 31.4Sjtc# The Regents of the University of California. All rights reserved. 41.1Scgd# 51.1Scgd# This code is derived from software contributed to Berkeley by 61.1Scgd# Kenneth Almquist. 71.1Scgd# 81.1Scgd# Redistribution and use in source and binary forms, with or without 91.1Scgd# modification, are permitted provided that the following conditions 101.1Scgd# are met: 111.1Scgd# 1. Redistributions of source code must retain the above copyright 121.1Scgd# notice, this list of conditions and the following disclaimer. 131.1Scgd# 2. Redistributions in binary form must reproduce the above copyright 141.1Scgd# notice, this list of conditions and the following disclaimer in the 151.1Scgd# documentation and/or other materials provided with the distribution. 161.1Scgd# 171.1Scgd# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 181.1Scgd# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 191.1Scgd# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201.1Scgd# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 211.1Scgd# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 221.1Scgd# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 231.1Scgd# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 241.1Scgd# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 251.1Scgd# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261.1Scgd# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 271.1Scgd# SUCH DAMAGE. 281.1Scgd# 291.7Schristos# @(#)kill 8.2 (Berkeley) 5/4/95 301.1Scgd 311.1Scgd# Convert job names to process ids and then run /bin/kill. 321.1Scgd 331.1Scgdkill() { 341.1Scgd local args x 351.1Scgd args= 361.1Scgd for x in "$@" 371.1Scgd do case $x in 381.1Scgd %*) x=`jobid "$x"` ;; 391.1Scgd esac 401.1Scgd args="$args $x" 411.1Scgd done 421.1Scgd /bin/kill $args 431.1Scgd} 44