File: pkill

package info (click to toggle)
smstools 3.1.21-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,908 kB
  • sloc: ansic: 18,785; sh: 1,196; php: 115; makefile: 41; awk: 17
file content (11 lines) | stat: -rwxr-xr-x 288 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
#! /bin/sh
# This script can be used to kill a program by its name.
# Please install this script only if your operating system
# does not have such a command already.

if [ "$1" = "" ]; then
  echo "Usage: pkill name"
else        
  kill `ps -e | grep $1 | awk '{print $1}'`
  exit $?
fi