Created
December 20, 2019 17:39
-
-
Save adamjstewart/1d377e92a224dfe2f12fabeb154586cf to your computer and use it in GitHub Desktop.
Primitive example of a self-aware program that passes the mirror test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Continuously kill processes | |
# Use Ctrl+C to exit | |
while true | |
do | |
read -p "kill " pid | |
if [[ "$pid" == $$ ]] | |
then | |
echo "I can't kill my own process!" | |
else | |
echo "Killing processing $pid..." | |
kill $pid | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment