summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-07-02 10:05:50 +0200
committerJoe <rbo@gmx.us>2024-07-02 10:05:50 +0200
commit87d13157a1e060634be415aa9bf1fcf90b90bac6 (patch)
tree5442f69cb95f7b363fc1f3442fd4b307b204e199
parentup (diff)
downloaddotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.gz
dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.bz2
dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.xz
dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.tar.zst
dotfiles-bsd-87d13157a1e060634be415aa9bf1fcf90b90bac6.zip
up
-rwxr-xr-x.local/bin/dmkill11
1 files changed, 6 insertions, 5 deletions
diff --git a/.local/bin/dmkill b/.local/bin/dmkill
index 521f315..9c7c838 100755
--- a/.local/bin/dmkill
+++ b/.local/bin/dmkill
@@ -29,7 +29,6 @@ sub confirm
sub action
{
my ($var, $user) = @_;
- my @split;
my $pid;
my $proc;
@@ -37,10 +36,12 @@ sub action
if (not $var) {
return;
}
- @split = split / $user /, $var;
- $pid = $split[0];
- $pid =~ s/\D//g;
- $proc = (split / /, $split[1])[0];
+ if ($var =~ /^\s*(\d+)\s/) {
+ $pid = $1;
+ }
+ if ($var =~ /^\s*\S+\s+\S+\s+(\S+)/) {
+ $proc = $1;
+ }
if (confirm($pid, $proc) == 1) {
exec(KILL_PATH, '-9', $pid);
}