r/cprogramming • u/cdtrmnbaell • 1d ago
Myshell
https://github.com/tracebyte8/myshell-linux-mini-shellBasic project to learn more about Linux system calls and C programming. I accept any criticism.
4
Upvotes
2
u/flyingron 1d ago
I find the include file that does nothing other than include include files a bit grody and blows encapsulation out of the water. Only put as much in any single include file (and c file for that matter) necessary to compile it.
Similarly, the
read(); while(cond) { do_something(); read(); } is also problematic.
3
u/codeOfError 1d ago
Hey, I tried your shell project. Neat project!
A few issues I noticed while testing:
1: Pressing Enter on an empty line causes a segmentation fault
2: mkdircreates the directory, but it printsmkdir failed: File exists.3: ls > file.txtdoesn't seem to work.Let me know if I'm doing anything wrong.