Created
November 27, 2019 19:45
-
-
Save willeccles/1eb0c7909e39c53685b24e48fc4ea9ba 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
#! /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