in reply to Why isn't this a quine?

It's not a true quine. A true quine generates it's own source. This only finds the file that contains the source and prints it.

It also has a race condition: if I replace the file shortly after you've run it, it will output whatever is in the new file and not the source code.

Replies are listed 'Best First'.
Re^2: Why isn't this a quine?
by mchampag (Acolyte) on Aug 02, 2009 at 00:03 UTC
    Now that's the sort of response I was expecting. So it's not enough to simply print out its code listing; a quine must also generate itself. Very koan-like.

    Thank you!
Re^2: Why isn't this a quine?
by JadeNB (Chaplain) on Aug 03, 2009 at 15:33 UTC
    A true quine generates it's own source.
    What does it mean to ‘generate’ source? Unless you mean something subjective like “uses clever or tricky-to-understand mechanisms”, it seems to me that the OP's proposed quine ‘generates’ its source using a call to system, which makes a further call to cat.