This code provides a basic implementation of a shell in C++, demonstrating how a shell interacts with the terminal to handle basic functions such as user input in raw mode, command execution, pipe management, redirection, and maintaining command history.
Prerequisites : To try out this code, it must be run in a Unix-based environment. Windows does not natively support commands like "fork", so you may use WSL (Windows Subsystem for Linux) for this purpose.
Execution : First, navigate to the directory containing the code.
Then compile and run the shell program:
g++ main.cpp -o shell ./shell
I will be uploading a doc for explaining this implementation soon, till then you can reffer from the comments of the code.
Happy Learning !!