I never really knew what a shell actually was until I switched my entire workflow to Linux and started using EndeavourOS as my daily driver. That completely changed the way I think and work inside a terminal.
As I started using the terminal more interactively, I realized that the terminal itself is just a container that provides a medium for interaction. The actual thing working behind it is the shell, which sits between the user and the kernel for communication. This made me curious about shells — how they process commands and what they are actually made of.
So I started building my own shell.
The basic idea was simple: start a loop that takes input and performs some operation. But as I moved ahead, lots of things started appearing in the way.
The first thing I faced was handling basic input/output, but without using printf and scanf, because these methods require formatting and are more one-ended operations. Instead, I switched to read() and write() system calls, which can continuously read and write through specified streams (STDIN_FILENO / STDOUT_FILENO).







