From 43e4f47d128827ffa4ad37102bffd5aea82b5d54 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 8 Aug 2024 23:51:39 +0100 Subject: [PATCH] [suicidal.sh]: add new suicidal.sh --- README.md | 1 + suicidal.sh | 4 ++++ 2 files changed, 5 insertions(+) create mode 100755 suicidal.sh diff --git a/README.md b/README.md index 68c98cf..800dd22 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,4 @@ repository to house scripts that were not useful enough to earn a place in there ## Overview - `recursive.sh`: a script that calls itself. - `self_destruct.sh`: a script that deletes itself. + - `suicidal.sh`: a script that kills the process that's executing it, i.e. itself. diff --git a/suicidal.sh b/suicidal.sh new file mode 100755 index 0000000..2b98f5c --- /dev/null +++ b/suicidal.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# A script that kills the process that's executing it, i.e. itself + +pkill "$(basename "$0")"