From 7def1207695593c03abc0dd8ad2c509369a944b7 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 9 Nov 2021 11:00:29 +0100 Subject: [PATCH] bash: psk verbessert --- .bash_functions | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.bash_functions b/.bash_functions index 24f183e..17716bb 100644 --- a/.bash_functions +++ b/.bash_functions @@ -2,8 +2,6 @@ function rgf { rg --files -g "*$1*" } -function psk { - ps -ef | grep $1 | grep -v grep | awk '{ print $2 }' | xargs kill -9 } function ffind { find $1 -type f -name $2 @@ -46,3 +44,16 @@ function m2m { fi fi } +function psk { + if [[ "$1" == "--help" ]]; then + echo "Beende Prozess '$1'" + echo "psk = ps kill" + echo "psk " + else + if [ -z "$1" ]; then + echo "Prozessname fehlt..." + else + ps -ef | grep $1 | grep -v grep | awk '{ print $2 }' | xargs kill -9 + fi + fi +}