You are browsing as a guest. Sign up (or log in) to start making projects!

3h 18m 19s logged

Spent the last 3 hours building the core execution engine for my C-Shell. I implemented external command execution by scanning $PATH and using the fork() and execv() syscalls. The biggest challenge was getting I/O redirection and piping to work correctly. I used dup2() to hijack standard input/output and route them through anonymous temporary files (tmpfile()) to handle multiple file redirections at once.I also ran into a brutal segmentation fault because my built-in commands weren’t expecting redirection operator tokens. I ended up doing a massive architectural refactor to move the entire file descriptor routing to the parent shell level. Now, whether it’s an external binary like ls or my custom peek built-in, they both seamlessly read and write through pipes and files!

0
8

Comments 0

No comments yet. Be the first!