A simple UNIX command line interpreter written in C.
This project is a simple shell implementation written in C. It mimics the basic functionality of a UNIX shell, allowing users to interact with the operating system via command-line instructions. The shell reads commands from standard input, executes them, and displays the results.
- Command execution
- Input redirection
- Output redirection
- Built-in commands
cd
exit
env
- Error handling
To install and run the simple shell, follow these steps:
- Clone the repository:
git clone https://github.com/Jaaf4r/simple_shell.git
- Navigate to the project directory:
cd simple_shell
- Compile the source code:
gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
To start the shell, run the compiled executable:
./hsh
You can then enter commands as you would in a regular shell. For example:
$ ls -l
$ pwd
$ cd /path/to/directory
$ echo "Hello, world!"
To exit the shell, use the exit command:
$ exit
The following built-in commands are supported:
- cd [directory]: Change the current directory to the specified directory.
- exit [status]: Exit the shell with an optional status code.
- env: Print the current environment variables.
- This project was inspired by the need to understand the inner workings of a UNIX shell.
- Special thanks to all the contributors who helped in improving this project.