|
|
|
|
|
by jonathonf
2186 days ago
|
|
That wasn't quite what I was trying to show with the snippet - I was intimating that you can use tcc to run C directly in something like a shell script. If you want to make `tcc -w -run` etc. more convenient then: alias trun='tcc -w -run - <<<'
trun 'main() { printf("Hello\n"); return 0; }'
---I can't edit my parent comment now, but it can be improved with e.g. //usr/bin/tcc -run $0; exit
main() { printf("Hello\n"); return 0; }
|
|
I know, but the first example in the link was:
So I figured I'd complement your example use with one that was more analogous to that.> I can't edit my parent comment now, but it can be improved with e.g.
To be honest, I liked your original example more. Using that `//` "shebang" depends on what shell it's invoked from, and it wouldn't work when calling exec from other languages. For example, with your last example using `//`:
while it would work with the `#!` shebang, since that's handled by the kernel.