Th goal of this project is to implement a simple Unix shell -- What is a Unix shell? A Unix shell is a command-line interpreter or shell that provides a command-line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language and is used by the operating system to control the execution of the system using shell scripts. Users typically interact with a Unix shell using a terminal emulator; however, direct operation via serial hardware connections or Secure Shell is common for server systems. All Unix shells provide filename wildcarding, piping, here documents, command substitution, variables, and control structures for condition-testing and iteration.[source: Wikipedia]
- Man Page
- Checkout shell/linux memes
- Header file
- New environment file
- File containing string functions
From the project instruction, we were asked to replicate some builtins you woul find in a normal unix shell, along with that we were also tasked with some features of the normal unix shell. Some of these builtins and features we weere able to replicate are highlighted in the table below and vice versa.
Features | Implemented | |
---|---|---|
1 | handles command line arguments | YES |
2 | implements builtins | YES |
3 | uses the PATH | YES |
4 | uses exit status | YES |
5 | shell continues upon Crtl+C (^C) | YES |
6 | custom strtok function | YES |
7 | handles comments (#) | YES |
8 | handles ";" | YES |
BUILTINS | Implemented | |
---|---|---|
1 | exit | YES |
2 | env | YES |
3 | setenv | YES |
4 | unsetenv | YES |
5 | help | YES |
-----> Requirement
* Any Ubuntu distribution
* GCC installed (gcc 9.3.0)
----->
Follow below steps to setup locally:
- clone repo:
git clone https://github.com/stenwire/simple_shell.git
- change into repo:
cd simple_shell
- verify all files
- Compile:
gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
- Run the shell in interactive mode:
./hsh
or run the shell in non-interactive mode:echo "<your command here>" | ./hsh
Stephen Nwankwo | HARUNA BERIKISU |
---|---|
Github | Github |
Nil |
This project will bee made open source and can be freely contributed to from/after 19-05-2022, please checkout Contribution guildline