Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or as was posted to https://news.ycombinator.com/item?id=29874052 by @jcalvinowens a few hours ago, we can also simplify this to just:

  #!/bin/cat
Example:

  $ echo '#!/bin/cat' > foo
  $ chmod +x foo
  $ cat foo
  #!/bin/cat
  $ ./foo 
  #!/bin/cat


or just an empty string for various languages


Seems like that would only work for languages where the last returned value is printed as-is when running it. Other languages wouldn't print `""` but have no output instead.


I think they meant that the program would be 0 bytes long, not two characters which are both quotation marks


Ah, I see. Funny lateral thinking exercise I guess, not so interesting in terms of actually creating a Quine :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: