In this assignment you will write smallsh your own shell in C. smallsh will implement a command line interface similar to well-known shells, such as bash. Your program will
- Print an interactive input prompt
- Parse command line input into semantic tokens
- Implement parameter expansion
- Shell special parameters $$,
$?, and $ ! - Tilde (~) expansion
- Implement two shell built-in commands: exit and cd
- Execute non-built-in commands using the the appropriate EXEC(3) function.
- Implement redirection operators ‘<’ and ‘>’
- Implement the ‘&’ operator to run commands in the background
- Implement custom behavior for SIGINT and SIGTSTP signals
Make sure that you have an environment where you can run C program. There are two ways to run the project.
- With the attached the makefile.
make
./smallsh
ctrl + c to exit- Compile files with gcc 99
gcc -std=c99 -o smallsh smallsh.c
./smallsh
ctrl + c to exitIt took me about 10 days to build this project. Prior to this project, I already finished "base64 encode project" and "tree project" to warm up.
Created by Hiromi Watanabe. Please do not use this to cheat on your project.