[disappearing.sh]: Add disappearing.sh

This commit is contained in:
2025-02-13 14:21:44 +00:00
parent cb73c82ee9
commit 55bd957771

12
src/disappearing.sh Executable file
View File

@ -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"