3 # Description: Fuzzy list and kill a (zombie) process by name
5 # Dependencies: fzf, ps
7 # Note: To kill a zombie process enter "zombie"
9 # Shell: POSIX compliant
10 # Author: Arun Prakash Jana
12 printf "Enter process name ['defunct' for zombies]: "
15 # shellcheck disable=SC2009
16 if [ -n "$psname" ]; then
17 if type sudo >/dev/null 2>&1; then
19 elif type doas >/dev/null 2>&1; then
25 if type fzf >/dev/null 2>&1; then
31 cmd="$(ps -ax | grep -iw "$psname" | "$fuzzy" | sed -e 's/^[ \t]*//' | cut -d' ' -f1)"
32 if [ -n "$cmd" ]; then