logoalt Hacker News

gblarggtoday at 7:47 AM0 repliesview on HN

I do this to embed shell commands at the beginning of short one-file C/C++ programs to execute when hitting an F key in my text editor. I usually put very basic compile-and-run commands. It's wrapped in #if and #endif which are comments in many shells. I end the commands with exit so it doesn't try to execute the code as commands.