Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # term v1.0 - Kills processes by their names. If several processes use the same name they're all gonna be terminated.
- if [ -z "$1" ]; then
- ps -e
- exit
- else
- PID=$(ps -e | grep $1 | awk -F ' ' '{print $1}')
- fi
- if [ -z "$PID" ]; then
- echo $1": No active process with that name."
- exit 1
- fi
- for NUM in $PID; do
- kill $NUM
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement