IIT Guwahati, India : CS-341 Assignment task - Make a UNIX Shell with some basic functionalities.
$ gcc main.c
$ ./a.out
> <command-to-run>
Displays the list of in-built functionalities.
Changes the current working directory to the path specified.
Lists all the files/directories present in the current working directory.
Removes the specified files. Use the -r
flag to remove a directory.
-v
flag displays the filename which is deleted.
Removes all the files in the current directory except the spefied files. NOTE:- It doesn't delete the directories in the current directory.
Displays the 'n' recent commands on the screen. If n is not spefied, then all the commands are displayed.
Runs the n-th command again. Use the history
command to check the number of the command.
This will run the specified program. It supports the redirection operators > output_file
and < input_file
.
Note :- --tkill n
is used to specify the time(in seconds) after which the program is terminated irrespective of whether the execution of child thread is completed or not.
Exits the terminal.
- Implemented all the features asked in the question statement.
- Every command of the user is run as a separate thread forked by the main thread.
- The memory used by history of commands is allocated dynamically in chunks of 10 commands. This is memory effecient and stores the complete history.
- Each command given as input by the user also uses dynamic memory allocation in chunks of 1024 characters.
- The code is completely modular. It is very effecient to read and understand with all the comments.
There are no bugs.
Abhishek Goyal
Roll No - 150101002
IIT Guwahati (CSE)
Rohan Aggarwal
Roll No - 150101052
IIT Guwahati (CSE)
Roopansh Bansal
Roll No - 150101053
IIT Guwahati (CSE)