Skip to content

Instantly share code, notes, and snippets.

@willeccles
Created November 27, 2019 19:45
Show Gist options
  • Save willeccles/1eb0c7909e39c53685b24e48fc4ea9ba to your computer and use it in GitHub Desktop.
Save willeccles/1eb0c7909e39c53685b24e48fc4ea9ba to your computer and use it in GitHub Desktop.
#! /bin/bash
tempfile=$(mktemp /tmp/cjit.XXXXXXXXXX)
gcc -x c -o "$tempfile" - <<EOL
#include <stdio.h>
int main(void) {
puts("Welcome to the future of programming!");
return 0;
}
EOL
if [[ $? != 0 ]]; then
rm -f "$tempfile"
exit $?
fi
exec "$tempfile"
rm -f "$tempfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment