Skip to content

Instantly share code, notes, and snippets.

@crclark96
Last active October 6, 2020 15:07
Show Gist options
  • Save crclark96/f274e0fb7f426f3212d15aa5762dd8aa to your computer and use it in GitHub Desktop.
Save crclark96/f274e0fb7f426f3212d15aa5762dd8aa to your computer and use it in GitHub Desktop.
#!/bin/bash
tail -n+3 "$0" | gcc -xc - && ./a.out && rm ./a.out ; exit
//
#include <stdio.h>
int main() {
printf("C is a scripting language!\n");
}
/tmp
➜ /bin/cat a.c
#include <stdio.h>
int main() {
printf("C is a scripting language!\n");
}
/tmp
➜ ./a.c
C is a scripting language!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment