Skip to content

Instantly share code, notes, and snippets.

@74hc595
Created August 5, 2015 04:34
Show Gist options
  • Save 74hc595/62c122755ec070b629d9 to your computer and use it in GitHub Desktop.
Save 74hc595/62c122755ec070b629d9 to your computer and use it in GitHub Desktop.
A C source file that can be "executed" like a shell script.
#define IM_A_LITTLE_POLYGLOT /*
gcc $0 && ./a.out; exit
*/
/*
1. Save as foo.c
2. chmod +x foo.c
3. Run with ./foo.c
*/
#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment