prash stands for 'Pratyay's Shell' and is a bash-like UNIX shell written in C.
Compilation + Execution: Run the following command in the shell directory
make run
Compilation Only : Run the following command in the shell directory
make
To run from any directory
<path_to_shel_dir/prash>
- echo
- ls
- cd
- pwd
- pinfo
- repeat
- fg
- bg
- sig
- jobs
Ctrl + Dlogs the user out of prash.Ctrl + Cinterrupts current foreground jobCtrl + Zpushed foreground job to background and changes state to 'stopped'.- Piping and redirection support.
- Path length does not exceed 4096 characters
- Command length does not exceed 8192 characters
- As clarified, only valid input involving pipes and redirection will be given (no two '>' in a single command, input and output redirection at only the first and last pipes respectively, etc.)
bgproc.c , .h: To deal with background processescd.c, .h: To implement thecdcommandls.c, .h: To implement thelscommandpinfo.c, .h: To implement thepinfocommandcommands.c, .h: To parse each individual command, and invoke appropriate custom/system commands.pwdecho.c, .h: To implement thepwdandechocommandsshell.c, .h: To print the prompt, and get the user's input. Also handles therepeatcommand.globalheader.h: Has all the necessary system header file inclusion statements, and also declares some global variables using theexternkeyword, also has theMAXPATH,MAXCMDmacros.pipes.h: Handles redirection and piping, acts as an intermediate layer between the shell and command handler.