From bf926c8e84627a46107d7f64255af894eb38304a Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 25 Apr 2017 17:19:06 -0400 Subject: [PATCH] shell/fzf: add bin/fzf-kill --- shell/fzf/bin/fzf-kill | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 shell/fzf/bin/fzf-kill diff --git a/shell/fzf/bin/fzf-kill b/shell/fzf/bin/fzf-kill new file mode 100755 index 00000000..0aa0310d --- /dev/null +++ b/shell/fzf/bin/fzf-kill @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Interactively select a process to kill. + +pid=$(ps -ef | sed 1d | gui-fzf -m | awk '{print $2}') + +if [[ $pid ]]; then + xargs kill -${1:-9} <<< "$pid" +fi