From 55bd957771eb7a3f563fca033739e3eb5d9792fb Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 13 Feb 2025 14:21:44 +0000 Subject: [PATCH] [disappearing.sh]: Add disappearing.sh --- src/disappearing.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 src/disappearing.sh diff --git a/src/disappearing.sh b/src/disappearing.sh new file mode 100755 index 0000000..c1a2689 --- /dev/null +++ b/src/disappearing.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Script that deletes its source code while executing and replaces it when exiting, hence "disappearing" while running and re-appearing once finished + +file_contents=$(cat "$0") +rm "$0" + +for i in $(seq 1 10); do + echo "Doing something invisible" + sleep 1 +done + +echo "$file_contents" > "$0"