helm/shell/sk/bin/sk-kill

10 lines
174 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# Interactively select a process to kill.
2018-03-23 12:29:50 -07:00
pid=$(ps -ef | sed 1d | sk -m | awk '{print $2}')
if [[ -n $pid ]]; then
xargs kill -${1:-9} <<< "$pid"
fi