Created
March 9, 2011 05:51
-
-
Save darkhelmet/861756 to your computer and use it in GitHub Desktop.
Run *.c files as scripts. Put this in ~/bin/cscript
This file contains 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
#!/usr/bin/env bash | |
tail -n `wc -l $1 | awk '{ print $1 }'` $1 | gcc -xc - -o ~/.cscript && ~/.cscript |
This file contains 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
#!/usr/bin/env cscript | |
#include <stdlib.h> | |
#include <stdio.h> | |
int main(int argc, char ** argv) { | |
printf("Hello, World!\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment