This is a sample Shell which is an assignment that i did during my Operating Systems course in third semester. The requirements of the assignment is as follows:-
- The prompt should display in the following format <username@system_name:curr_dir> .
- The shell should support different builtin commands such as ls,pwd,cd,echo, etc. .
- The builtin commands should not use the execvp() or similar other such functions, i.e students need to implement them..
- Particularly ls should also support options such as -a,-l,-al/-la or some_directory name.
- The system commands, both with and without the arguments should be supported.
- For the system commands, use of execvp() is allowed.
- The background processes must also be supported for example ls &.
- pinfo command which prints the information related to the process whose pid is given as an argument to it..
- In case there is no argument given to the pinfo command then it should give info about the shell program.
- Status of the background process that returns after completion must be printed.
- nightswatch which will support one option -n seconds and two different commands, intterupt and dirty. .
- Press q or Q to exit the nightswatch command.
- interrupt command will print the number of interrupts by keyboard controller after every specified number of seconds.
- dirty command will print the size of the part of memory which is dirty.
- Also the history commands need to be supported which shows the last few commands which the user entered. .
- The user can also specify the number of commands to show in history as an argument.
- Multiple commands can be given at once separated by semi-colon.
- To exit the shell program type the command exit.
To clone and run this application, you will need Git. From your command line:
#clone this repository
$ git clone https://github.com/kanishk779/Assignment1_CSE_SHELL
#go into the directory Assignment1_CSE_SHELL
$ cd Assignment1_CSE_SHELL
#build the project using meson build system
$ meson build
$ ninja -C build
#go into the directory build
cd build
#build run the shell
$ ./output
#for doing the cleanup first ensure you are in Assignment1_CSE_SHELL directory
$ cd ..
#remove the directory build
$ rm -rf build
- The pinfo will not work for mac Operating system because the /proc directory does not exist.
- Similarly the nightswatch command will not work for the mac Operating system.