File: pkill

package info (click to toggle)
smstools 3.1.15-1.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 1,656 kB
  • ctags: 879
  • sloc: ansic: 14,857; sh: 1,195; php: 115; makefile: 48; 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