Lazy Shell is a lightweight, educational Unix-like shell implemented in C. It provides a simple command-line interface, supports built-in commands, pipelines, I/O redirection, background job control, and basic signal handling.
Lazy_Shell/
βββ include/
β   βββ shell.h               # Public headers and declarations
βββ src/
β   βββ command_executor.c    # Fork/exec logic for external commands & built-ins dispatcher
β   βββ job_controller.c      # Background/foreground job management and status checking
β   βββ parser.c              # Command-line parsing (splitting tokens & detecting pipelines)
β   βββ pipeline_executor.c   # Setting up pipes and executing two-stage pipelines
β   βββ redirection_handler.c # Handling `<` and `>` I/O redirection
β   βββ signal_handler.c      # Installing signal handlers for SIGINT/SIGTSTP
β   βββ shell.c               # Main loop, prompt, and dispatch logic
βββ tests/                    # (Optional) unit/integration test cases
βββ Makefile                  # Build rules for compiling the shell
βββ README.md                 # This file
- Built-in commands:
- cd <dir>: Change the current working directory
- help: Display a help message and list of built-ins
- exit: Exit the shell
 
- External commands: Fork + execvp()support for any system executable.
- Pipelines: Connect two commands via |, e.g.ls -l | grep ".c".
- I/O Redirection:
- < input.txt: Redirect stdin from file
- > output.txt: Redirect stdout to file (overwrite)
 
- Job Control:
- Background jobs with &
- Ctrl-C(SIGINT) kills the running child process without exiting the shell
- Ctrl-Z(SIGTSTP) suspends the child process and adds it to the job list
 
- Background jobs with 
- Job Table: Tracks up to 100 jobs, prints status messages when jobs stop or finish.
- Signal Handling: The shell itself ignores SIGINT/SIGTSTP; children reset to defaults.
- 
Clone the repo git clone https://github.com/yourusername/Lazy_Shell.git cd Lazy_Shell
- 
Compile make This produces the lazy_shellexecutable inbin/(or the project root).
- 
Run ./shell You should see the ASCII welcome banner and the prompt Lazy shell $.
- 
Clean make clean 
If you add test cases in the tests/ directory, you can automate running them via:
make test(No tests are included by default.)
Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request.
This project is released under the MIT License. See LICENSE for details.