3 ms·
A basic shell with just forks and execs binaries from $PATH and nothing more. Maybe, just maybe, file redirection. You won't have neither echo(1) or cat(1), you
by anthk 7y ago
A basic shell with just forks and execs binaries from $PATH and nothing more. Maybe, just maybe, file redirection. You won't have neither echo(1) or cat(1), you must reimplement them. Echo(1) is damn easy.
- pishpash 7y agoBetter would be to have a scheduled execution of some bits on the disk, every 5 minutes or so, and you are only allowed to write to disk, not execute anything on your own.
- kchr 7y agoSounds like a neat scenario for a CTF :-)
- rmetzler 7y agoMaybe I’m dumb, but how would you write cat or echo if you don’t have a “terrible editor”?
- anthk 7y agogcc accepts compiling code from stdin. If not: >> echo.c << EOF #include <stdio.h> int main(){ while((c = getline()) != EOF){ putchar(c); } } EOF