scripting in pure C
Posted: Tue Nov 25, 2014 10:45 am
Cool trick if you're not that into shell scripting and prefer C.
Grab a copy of TCC here, because it doesn't create a ton of bytecode overhead. It's fast, and if you're that into C, you want it anyhow.
Write a program in C to do what you like, but then above all the includes, add a shebang line like this:
Chmod your file to 755 (or +x, assuming that's how you roll), and then just run it as a script.
Grab a copy of TCC here, because it doesn't create a ton of bytecode overhead. It's fast, and if you're that into C, you want it anyhow.
Write a program in C to do what you like, but then above all the includes, add a shebang line like this:
Code: Select all
#!/usr/local/bin/tcc -run