ugnvs
(Eugene)
May 8, 2026, 12:01pm
1
Quine is a program which takes no input and prints its own code as its only output. For more detail see Quine (computing) - Wikipedia
Do you want to solve quine puzzle by yourself?
Do not open the following section until you are helpless and need a hint.
Quine example in Python
self="""
print('self=""{}'.format('"'),end='')
for i in self:
print(i, end='')
print(3*'"')
print(self)"""
print('self=""{}'.format('"'),end='')
for i in self:
print(i, end='')
print(3*'"')
print(self)
4 Likes
tkn
(thom)
May 8, 2026, 12:52pm
2
I don’t know if I understand it fully.
Does this count as a quine ?:
bash example
#!/bin/bash
echo "$(<$0 )"
3 Likes
ugnvs
(Eugene)
May 8, 2026, 1:14pm
3
Congratulations! It does!
Verification
$ cat tkn.sh
#!/bin/bash
echo "$(<$0)"
$ ./tkn.sh
#!/bin/bash
echo "$(<$0)"
Update: It looks like it reads its code from file… That is it receives input. No, I’m afraid that does not qualify as quine.
4 Likes
tkn
(thom)
May 8, 2026, 1:51pm
4
Took me a while but I think I got it.
Does this qualify as a quine ? (no input files used)
new bash example
echo $BASH_COMMAND
2 Likes
ugnvs
(Eugene)
May 8, 2026, 2:05pm
5
I think it is a marginal situation. May be you find interesting BashQuine - Greg's Wiki
4 Likes
tkn
(thom)
May 8, 2026, 2:19pm
6
Thanks for the link
I tend to think that my solution is valid though
see: Bash Reference Manual
Validation
thom@monolith:~$ cat ./quine
echo $BASH_COMMAND
thom@monolith:~$ ./quine
echo $BASH_COMMAND
EDIT: I just took a peek at your link. Seems that they also came up with my solution. According to that site, it is considered valid.
3 Likes
Eugene, Thom,
After reviewing the Wikipedia link, my poor brain couldn’t possibly attempt the puzzle, for fear of burning out the neuron networks!
Given that you two did subject yourselves to that truly esoteric challenge, I would like to offer you a well deserved award button:
4 Likes