Terminal shell in C to understand exceptional control flow.
This shell was created to apply concepts learnt in Chapter 8 of CS: APP
What works and what is left:
- It has a really cute logo 🔥
- Executes commands by spawning child processes: try sleep 30 in this shell and quickly ps -j -h | grep sleep in bash to see the child process you have created.
- Demonstrates the concept of signal handling: try sleep 30 and ctrl + c to send a SIGINT which kills the child process, you can check using the ps command previously explained.
- Operator handling: implements the && and || operators as they work in bash.
- Implements the notion of a foreground process with the & operator: try sleep 30 & sleep 40 & sleep 50, then ctrl + c which sends a signal only to terminate sleep 50, since the rest are background processes.
TODO:
- builtins, implemented the alias builtin which turned into a big ball of mud, so currently only exit works.
- job control: things such as the bg, fg and jobs command, which will be the end of this project!
- compile: gcc shell.c
- run binary: ./a.out
A pretty wack shell
![image](https://private-user-images.githubusercontent.com/32122172/278198935-8a02672d-a701-4b7b-b210-86b97e18940e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MDA2NjAsIm5iZiI6MTczOTQwMDM2MCwicGF0aCI6Ii8zMjEyMjE3Mi8yNzgxOTg5MzUtOGEwMjY3MmQtYTcwMS00YjdiLWIyMTAtODZiOTdlMTg5NDBlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDIyNDYwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5ZjVhNDY5YzM1NDhjNWUxOTgwZjFiMWNhYzM2ZThlM2NiZThlNGJjZjE0YTM2OTk1NWY5MjZiNjRhODQyY2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qlxBOkP1leaiQCAe3SKO5DBI2fme0wjy8fX7IyTCap8)