I need a little time to study your 'strict mode' suggestion.
I used 'set -e' before but had problems with it.
Would you know how I could detect that input is cat'ed into
the script ? ($ cat snippet.c | runc -i). So that I can suppress 'Type your code then CTRL+D'.
This is not a complaint about the name. Just that as a command from the command line, "runc" may clash with the runc container running utility due to potential overlap in the likely users.
Again, it's not the project name just the potential clash at the OS level. Because over the years, I've done it to myself.
Reminds me of [1] "c" a utility which allows you to execute C code as if it were a script. It's a shame the name is almost unsearchable in Google though...
[+] [-] koolba|5 years ago|reply
Couple of immediate issues with the repo:
- Sample output in the README should not be prefixed with a "$". That's only for the shell command prompt.
- Use ``` blocks in your README file. It's easier to format multi-line text.
- Don't use $RANDOM, it's not secure. Use mktemp: https://github.com/alcover/runc/blob/73aaecea5a4cd357f7172dd...
- Don't exit with success if the command failed: https://github.com/alcover/runc/blob/73aaecea5a4cd357f7172dd...
- Use Bash strict mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
[+] [-] tomjakubowski|5 years ago|reply
You can get saner splitting for that loop over the array by quoting the array expansion:
Shellcheck lints that, by the way.[+] [-] alcover|5 years ago|reply
I need a little time to study your 'strict mode' suggestion. I used 'set -e' before but had problems with it.
Would you know how I could detect that input is cat'ed into the script ? ($ cat snippet.c | runc -i). So that I can suppress 'Type your code then CTRL+D'.
[+] [-] brudgers|5 years ago|reply
Again, it's not the project name just the potential clash at the OS level. Because over the years, I've done it to myself.
https://github.com/opencontainers/runc
[+] [-] alcover|5 years ago|reply
I admit I didn't research the name 'runc'.
Should I rename it ? I like this one because it's short and explicit.
[+] [-] MaxBarraclough|5 years ago|reply
See also Cling, an interactive C++ interpreter.
https://github.com/root-project/cling
[+] [-] skolskoly|5 years ago|reply
[+] [-] alcover|5 years ago|reply
Does not work in the spirit of my script though, since you would still need to add headers and main():
./snip.c:3:9: error: expected declaration specifiers or ‘...’ before string constant printf ("%d\n", i);[+] [-] solvorn|5 years ago|reply
[+] [-] fish45|5 years ago|reply
Also related is the tiny C compiler and its `tcc -run` command.
[+] [-] jonathonf|5 years ago|reply
[+] [-] cozzyd|5 years ago|reply
[+] [-] unknown|5 years ago|reply
[deleted]
[+] [-] crazypython|5 years ago|reply
[+] [-] gitgud|5 years ago|reply
[1] https://github.com/ryanmjacobs/c
[+] [-] neilparikh|5 years ago|reply
I wrote this for a hackathon, so please excuse the messy code :)
[+] [-] skissane|5 years ago|reply
https://en.m.wikipedia.org/wiki/Compile_and_go_system
[+] [-] khrbtxyz|5 years ago|reply
[+] [-] zx2c4|5 years ago|reply
[+] [-] glouwbug|5 years ago|reply
[+] [-] smabie|5 years ago|reply
[+] [-] verroq|5 years ago|reply
[+] [-] unknown|5 years ago|reply
[deleted]