3 ms·
(execve)... Challenge accepted. :-) Might be just a matter of a shebang at the beginning and an 'exec' before the final $p.
by emmelaich 9y ago
(execve)...
Challenge accepted. :-) Might be just a matter of a shebang at the beginning and an 'exec' before the final $p.
- modeless 9y agoYeah, a shebang is required, and unfortunately it isn't valid C so you can no longer feed the file directly to the compiler. I just figured out how to whittle it down to 2 lines though! Thanks for the // idea. Here it is in both shebang (2 line) and non-shebang (1 line) versions: https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83a7aa4e2 https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83...
- emmelaich 9y agoThanks, good stuff. dolmen/Olivier's followup is good too. I now remember why I used the complicated expr command and make; it's to ensure it works with C and C++. And any language that happens to accept // as a comment and is supported by "make". (note that no actual Makefile is required)
- modeless 9y agoThat is a cool feature! It's a bit annoying to have separate versions for C and C++.