As we introduced in class, the four functional characters I, &) are for input re
ID: 3802124 • Letter: A
Question
As we introduced in class, the four functional characters I, &) are for input redirection, output redirection, pipe and background jobs respectively. By default, they can be interpreted correctly by a UNIX terminal, but not by a C/C++ program. In a UNIx terminal if you type in "echo hello filel", you will find a file named "filel" created which has string "hello" stored inside, and that's because the terminal interpreted correctly and redirected the output of string "hello" from screen to "filel" In our Project 1, we want you to write a C/C++ program to interpret all these four functional characters as a UNIX terminal does. So when your program is running, we expect it to allow the user to type in a command line and if the user types in "echo hello filel", the same thing as in a UNIX terminal should happen. This is only the test for output redirection, and we expect the other three functional characters to be interpreted correctly as well. Note that function "system" cannot be used in your program because it will do everything for you. For example, "system("echo hello filel")," can give the right result without needing you to do anything. Instead, we want you to use system calls for process management and file systems, such as fork waitpid, execvp, exit pipe dup, open close, etc. First, your program should read in the user's command line and store it in an array. Then it checks if any of the four functional characters is in the array and will do corresponding work if so.Explanation / Answer
here you have to create a editor then using looping u can code for unix supporting commands.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.