- An interactive user defined shell in C
- Complile using "make"
- Recompile : delete all .o file by make clean and then again do make.
- Run using ./shell
- Works almost like normal shell
- Coloured prompt
- Keeps the directory where the shell is run, as home directory and shows the path of the current directory relative to that home directory
- Every command is run in new forked process
- Error Handling
- Commands which have '&' appended, run in background
- When background process exits, shell display a message with its exit status
These commands are implemented as a part of shell
- cd (Also "cd -" )
- echo
- pwd
- ls (ls -l, ls -al, ls -a, ls -la with directory name )
- setenv var [value]
- unsetenv var
- jobs
- kjob
- fg
- bg
- overkill
- quit
- CTRL-Z
- CTRL-C
- pinfo
- It returns process related information like pid, process status, memory, etc
-
If the background process exits then the shell will display the appropriate message to
the user and for foreground process shell will wait and regain its control once the process exist.
- Output of running one (or more) commands can be redirected to a file.
-
Program can handle any number of pipes.
- Use Case : Example => cat < in.txt | wc -l > lines.txt
- listed in Builtins Command
- If the background process exits then the shell must display the appropriate message to the user.
- nightswatch (interrupt,dirty)
- Non blocking user input method if User press 'q' then exit
- [ nightwatch -n t interrupt] It print the number of times the CPU(s) has(ve) been interrupted by the keyboard controller (i8042 with IRQ 1) t times on screen .
- [ nightwatch -n t dirty] It prints the total amount of memory, in kilobytes, waiting to be written back to the disk on every t seconds.
- Makefile
- Compile and link all file and made a executable file ./shell to run shell
- main.c
- Main file where shell is running and prompt is displaying
- read_and_parse.c
- Read user command and parse it i.e tokenise it.
- check_background_process.c
- Check if a process to be run in background
- launcher.c
- Launch the prepared execute instruction
- execute.c
- Preparing to execute the instruction
- filename.h
- containing respective libraries nedded
- redirection.h
- containing respective libraries nedded
- redirection.c
- Execute redirection command
- piping.h
- containing respective libraries nedded
- piping.c
- Execute and handle number of pipes
* cd.c
* echo.c
* ls.c
* exit_quit.c
* pinfo.c
* pwd.c
* nightswatch.c
* setenv_unsetenv.c
* jobs.c
* fg_bg.c
* kjob.c
* overkill.c
* builtin_func.h
Gulshan Kumar Aman Bansal
Copyright (C) - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited