I stumbled across a site that listed "Quines" - programs that self replicate (well, they output a printout or display of their own code and nothing else useful...).
I wondered if anyone has tried this with Bash??
Is "Quine" possible in bash?
Moderator: Forum moderators
- greengeek
- Posts: 1393
- Joined: Thu Jul 16, 2020 11:06 pm
- Has thanked: 537 times
- Been thanked: 193 times
Is "Quine" possible in bash?
-
- Posts: 1973
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 172 times
- Been thanked: 372 times
Re: Is "Quine" possible in bash?
under unix shells there is...
Author: Bruce Ediger (ediger@rtgds1.den.mmc.com)
Note: I hesitate to include this one. Do NOT run it, as it will fill up your HD
with ease.a='echo a=$c${a}$c > $$;echo b=$c${b}$c >> $$;echo c=$b${c}$b >> $$; echo $a >> $$;
chmod +x $$; ./$$'
b='"'
c="'"
echo a=$c${a}$c > $$;echo b=$c${b}$c >> $$; echo c=$b${c}$b >> $$;echo $a >> $$; chmod
+x $$; ./$$