# A “cheating” quine

Long-time lurker, first-time poster. So here goes.

In the Wikipedia page for quine, it says that "a quine is considered to be 'cheating' if it looks at its own source code." Your task is to make one of these "cheating quines" that reads its own source code.

This is , so the shortest code in bytes - in each language - wins. This means that a 5-byte Pyth script would not beat a 21-byte Python script - but a 15-byte Python script would.

You must use file I/O to read the source code, so the following JavaScript code, taken from the official Wikipedia page, is invalid:

function a() {
document.write(a, "a()");
}
a()


It must access the source code of the file on disk.

You are not allowed to specify the file name. You must make it detect the filename itself.

Everyone clear? Go!

• Is a trailing newlines not present in the original file allowed? – isaacg Oct 29 '15 at 22:04
• @isaacg IMHO That's not a quine, since it is not the source code. – mınxomaτ Oct 29 '15 at 22:05
• You should state a requirement that it determine the actual filename instead of assuming a hard-coded string for the source location. – feersum Oct 29 '15 at 22:26
• I agree with @feersum though, that requiring a specific file name makes this challenge way to trivial. – mınxomaτ Oct 29 '15 at 22:33
• Can we assume that (for compiled languages) the source code is in the same folder (i.e. we can just add ".cpp" or ".hs" to arg[0] to get the source). – HEGX64 Nov 1 '15 at 9:15

# Perl 6 / POSIX shell, 16 bytes

run 'cat',\$?FILE


Try it online!

# R, 44 bytes

cat(scan(sub(".*=","",commandArgs()[4]),""))


Prints to stderr as well. If that's not allowed this works for 46 bytes:

cat(readLines(sub(".*=","",commandArgs()[4])))


Run these from the command line using Rscript.