r/shittyprogramming • • Jul 15 '22
I wrote a quine in bash!
curl 'https://old.reddit.com/r/shittyprogramming/comments/vzn3ye/i_wrote_a_quine_in_bash/' | grep -Po '<pre><code>curl.*$' | cut -b12- | sed 's/\;/;/g' | sed 's/\"/"/g' | sed "s/\'/'/g" | sed 's/\</</g' | sed 's/\>/>/g' | sed 's/\&/\&/g'
107
Upvotes
4
u/TwoFiveOnes Jul 15 '22
but aren't you also replacing the entities in the sed calls
3
u/djcraze Jul 15 '22
Now do it without editing the post.
32
u/pxOMR Jul 15 '22
But that's cheating —
24
u/littleswenson Jul 15 '22
Is it still considered a quine if you read the text of the program from an external source?
22
u/F54280 Jul 15 '22
Facepalm.
An empty file is a legal bash file that produces an empty output, hence here is a bash quine:
10
u/rocketman0739 Jul 15 '22
https://c.tenor.com/JEn0vNDWE7wAAAAC/legal-is-that-legal.gif