Shell is a special user program which accepts simple human readable commands from user and translates them so that kernel can understand them. Shell provides an interface to user to use operating system services.
This shell is developed completely in C.
Prints all the builtin commands.
Used to change the current working directory of the shell.
Used to exit the shell.
Used to run a command in background.
Prints all the commands running in background.
Used to kill a process with specified process id.
Prints all the commands which were given to the shell along with their validity (i.e. whether they were valid or not) in the current session.
I have used a bit of concept of pipelining to implement this feature to send information from child processes to parent process. This command marks the invalid commands with RED color and valid commands with BLUE color.
Used to change the prompt name of the shell.
Used to reset the prompt name of the shell to default.
Follow these steps to run the shell in your pc.
-
Clone the repository.
-
Run following commands in your terminal.
gcc sh.c linkedlist.c linkedlist.h utilities.h utilities.c linkedListForHistory.c linkedListForHistory.h
./a.out
This will open the shell in your terminal.
Note - The commands given in step 2 assumes that you have gcc installed on your system.
-
Adding pipelining in the shell.
-
Enhance the ease of use of shell by implementing following -
- Command navigation using up arrow ⬆️ and down arrow ⬇️ key.
- Cursor navigation using left arrow ⬅️ and right arrow ➡️ key.
- Function of autocomplete using tab key.