4 ms·
Is there a way to do this and have the shell remove the temporary file after exec?
by suprjami 1y ago
Is there a way to do this and have the shell remove the temporary file after exec?
- 1vuio0pswjnm7 1y agoThere are many, no doubt #if 0 cc -static -pipe -xc "$0"||exit 100 exec ./a.out #endif int puts(const char *); int unlink(const char *); int main(int argc,char *argv[]){ puts("it works"); unlink(argv[0]); return 0; }
- teo_zero 1y agoYes, but it's not worth it. It's better to forget gcc and use tcc instead, which has the -run flag to compile and run without creating any intermediate file. It's also much quicker than gcc.