Super Simple Shell is a custom Unix-like shell implemented in C. It provides a basic command-line interface to interact with the underlying operating system by executing commands, supporting standard features like argument handling, built-in commands, and error reporting.
- Command Execution: Executes system commands using the
execvp
system call. - Built-in Commands: Supports internal commands like
cd
(change directory) andexit
to terminate the shell. - Custom Prompt: Displays a prompt indicating the current working directory for better context.
- Error Handling: Provides user-friendly error messages for invalid commands and system call failures.
- Basic Input Parsing: Handles input commands and arguments efficiently.
To clone and build the project:
-
Clone the repository:
git clone https://github.com/abhilov23/super-simple-shell.git cd super-simple-shell
-
Compile the shell:
gcc -o super_simple_shell.exe cell.c utils.c -I .
-
Run the shell:
./super_simple_shell.exe
-
Start the shell by running:
./super_simple_shell.exe
-
Execute commands as you would in a typical Unix shell. Examples:
ls -l cd /path/to/directory echo "Hello, World!"
-
Use the
exit
command to terminate the shell:exit
-
cd
: Changes the current working directory.cd [directory]
-
exit
: Exits the shell program.exit
- cell.c: Contains the main function, handles user input, and manages the shell loop.
- utils.c: Implements helper functions for command parsing, execution, and built-in commands like
cd
andexit
. - cell.h: Declares shared functions and constants used across the project.
The shell provides detailed error messages for situations such as:
- Invalid or unknown commands.
- System call failures.
- Incorrect usage of built-in commands.
- Advanced features like piping (
|
), I/O redirection (<
,>
), and background execution (&
) are not currently supported. - Input parsing is basic and may not handle all edge cases.
- Add support for pipelines (
|
) and background tasks (&
). - Improve input parsing to handle more complex command structures.
- Enhance I/O redirection functionality.
- Implement command history and tab-completion features.
This project is open-source and available under the MIT License. Feel free to use, modify, and distribute it.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes with clear and concise messages.
- Submit a pull request detailing your changes.
- Abhilov
For more information, suggestions, or feedback, feel free to reach out via GitHub. Happy coding!