Skip navigation.

Raphael's Blog

A look into a programmer's life

a simple bashism-powered quine



$ /tmp/foo
#!/bin/bash

echo "$(< $0)"




$ cat /tmp/foo
#!/bin/bash

echo "$(< $0)"



Update: just to clarify, this is a joke, not a real quine :wink:

Holidays holidays holidays"stress"-testing shell interpreters...

Comments

Anonymous 2. February 2008, 22:11

Ed Schouten writes:

#!/bin/sh
cat $0

Anonymous 3. February 2008, 09:54

Anonymous writes:

Fail.

Anonymous 3. February 2008, 10:00

Smartass writes:

$ cat factorial
#!/bin/sh

echo $(

Anonymous 3. February 2008, 13:17

Alfred M. Szmidt writes:

$ touch quine
$ chmod a+x quine
$ ./quine
$

You canot get it much shorter, or simpler than that.

Anonymous 31. May 2008, 17:57

Anonymous writes:

THIS is Bash quine!

$ cat > quine.sh
b=\' c=\\ a='echo b=$c$b c=$c$c a=$b$a$b; echo $a'
echo b=$c$b c=$c$c a=$b$a$b; echo $a

$ chmod +x quine.sh
$ ./quine.sh
b=\' c=\\ a='echo b=$c$b c=$c$c a=$b$a$b; echo $a'
echo b=$c$b c=$c$c a=$b$a$b; echo $a




by Tafuni Vito - Italy - vitotafuni_AT_gmail.com

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies