Created
June 22, 2011 00:39
-
-
Save ecounysis/1039285 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//&>/dev/null;x="${0%.*}";[ ! "$x" -ot "$0" ]||(rm -f "$x";cc -o "$x" "$0")&&"$x" $*;exit | |
#include <stdio.h> | |
int main() { | |
char c; | |
while ((c = getchar()) != EOF) | |
putchar(c); | |
return 0; | |
} | |
// I'd call this the most useful. I put this at the top of any simple single-file C scripts, so that I can execute them directly. It compiles if necessary and calls the executable, passing on any parameters. | |
// http://stackoverflow.com/questions/12830/most-elegant-amusing-or-strange-code-one-liners/12907#12907 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment