- This project consists for a basic iteration of Shell, made in C language. This project has some exclusive custom commands, as well as the others which bash features.
- Download the entire project, open up your terminal in Linux.
- Make sure you have GCC compiler installed. If you don't refer here.
- If you want to compile the project (not needed), paste
gcc acmsh.c linkedlist.c utilities.c -o Shell.out
in your terminal. - For running the Shell, paste
./Shell.out
inside your terminal. - Enter
help
for list of commands.
- C language
- Some C libraries such as
<sys/wait.h>
,<sys/types.h>
and<signal.h>
. - Libraries such as
<stdlib.h>
for adding color.
- Providing a few built-in functions, and seeing whether the command entered by user matches them. If yes, we call our custom function, or we call our
sh_launch()
function. - Important concepts in C such as
fork()
,exec()
and concepts of processes and their ID's.
- A fully working shell, which executes the normal functions of the default terminal, but also a few more custom functions so that the power user can use it to his ability.
- Custom
cd
command for changing directories. - Custom
exit
command for exiting the shell. - Running background jobs(by
sh_bg()
method) , listing all background jobs running at the moment (bysh_bglist()
method) and also functionality to kill a running background job (sh_kill()
method).
sh_history()
method : This method lists the latest 100 commands you have instructed to the Shell. It lists all these commands in chronological order. For avoiding usage of more memory, history automatically forgets the 100th oldest command issued. Usage :history
if you want to view full history, orhistory 3
if you want to list last 3 commands in the history.sh_again()
method : This method will help you to repeat any command in your history again by just entering the index for it in reverse order. Usage :again 2
will run the second-last command given by you. This is obviously dependent on sh_history() method. Most recent command can be run byagain 1
.find_size()
method : This method finds the amount of functions that have been provided so that while iterating over all builtin functions, we can loop over all of them.sh_google()
method : This method will help you search google with whatever query you provide next to it. Usage : Simplegoogle
will open Google on your browser, andgoogle strings
will search strings on the same. You can also search for strings with multiple words separated by spaces.sh_pwd()
method : Prints present working directory. Usage :pwd
.sh_help()
method : Lists all additional commands you can use. Usage :help
.sh_about()
method : Lists my name. Usage :about
- Color Coding : Additionally, all error messages are in red, all inputs are white, and messages from Shell itself are cyan for ease of use.
- Adding more features, like auto-complete for names of files and folders so that it is as useful as a normal terminal.
- Adding more custom features to execute custom routines and automation.
- Various features, including error handling is demonstated in the GIF below.