This project simulates a Linux terminal shell utilizing system programming concepts like process creation (fork()), inter-process communication (pipe()), and signal handling. It was developed as part of the COMP3230 Principles of Operating Systems course at The University of Hong Kong.
- Scored 11.5/12 for core functionality.
- Scored 4/4 for bonus features.
- Executes commands by creating child processes.
- Handles absolute, relative, and
PATHenvironment variable paths for command execution. - Supports built-in commands:
exit: Terminates the shell.timeX: Prints process statistics of terminated child processes.
- Implements operators:
&: Executes commands in the background.|: Pipes the output of one command as the input to another.
- Robust to
SIGINT(Ctrl-C) interruptions. - Handles
SIGUSR1for controlled execution of child processes. - Handles
SIGCHLDfor background process termination.
- Clone the repository:
git clone https://github.com/Henryyy-Hung/HKU-COMP3230-Shell
- Navigate to the project directory:
cd HKU-COMP3230-Shell/src - Build the project:
make all
- Run the shell:
./3230shell
