Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a question from an operating system course. This is a complete question and please read the question carefully. Thank you. Learn the concepts
This is a question from an operating system course. This is a complete question and please read the question carefully. Thank you.
Learn the concepts of the life-cycle of UNIX processes and inter-process communication. Description Write a basic UNIX shell in C that reads and processes commands. who Is -1 Is - > tempfile sort file2 sort > file22> errorlog sort file2 & ls -l | WC-1 cd /tmp history env jobs Other command examples: top,ls,w,top,uptime,cal,date,cp.gcc.grep You will want to wait() for the command to finish before printing your prompt and accepting other UNIX commands and use execvp) that looks in your default PATH. 'Control-d' will exit your shell as the commands are read from standard input, use the % character as a prompt. Hint: Take a look at the strtok library function. Each C program has 3 file descriptors: standard input, standard output and standard error. Your program should be able to redirect standard input and standard output redirection, append output redirection and error redirection. You should handle the control-c interrupt and when it receives a SIGUSR1 signal it should exit and leave a log file of the commands in the history. You should have "builtin" commands, the "cd" command and a "history" to show a history of commands, and "env" to show the environment, "jobs" command to show the list of background processes running. Look at the dup/dup2 system calls. Report Individual work only (no collaboration is allowed). Submit via Canvas. Along with the program source code, please also submit a short report ( tempfile sort file2 sort > file22> errorlog sort file2 & ls -l | WC-1 cd /tmp history env jobs Other command examples: top,ls,w,top,uptime,cal,date,cp.gcc.grep You will want to wait() for the command to finish before printing your prompt and accepting other UNIX commands and use execvp) that looks in your default PATH. 'Control-d' will exit your shell as the commands are read from standard input, use the % character as a prompt. Hint: Take a look at the strtok library function. Each C program has 3 file descriptors: standard input, standard output and standard error. Your program should be able to redirect standard input and standard output redirection, append output redirection and error redirection. You should handle the control-c interrupt and when it receives a SIGUSR1 signal it should exit and leave a log file of the commands in the history. You should have "builtin" commands, the "cd" command and a "history" to show a history of commands, and "env" to show the environment, "jobs" command to show the list of background processes running. Look at the dup/dup2 system calls. Report Individual work only (no collaboration is allowed). Submit via Canvas. Along with the program source code, please also submit a short report (Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started