Home /
Expert Answers /
Computer Science /
write-a-mathrm-c-program-to-implement-a-simple-linux-shell-command-line-interpreter-your-pa292
(Solved): Write a \( \mathrm{C}++ \) program to implement a simple Linux shell command line interpreter. Your ...
Write a \( \mathrm{C}++ \) program to implement a simple Linux shell command line interpreter. Your program should: 1. Provide the following command line interface \( \sim \$ \)./a.out command [parameter-1] ... [parameter- \( \mathrm{N}] \) 2. Execute the specified command (file) using the given parameters. Display an error message if an invalid command is given. 3. Write the given command to the output file log.txt. See sample screenshots below. Requirements: 1. Use the system calls fork0, wait0, and execvp0. 2. Create a child process to execute the given command (file). 3. The parent process should write the given command to the file log.txt 4. Your program must compile correctly using the \( \mathrm{g}++ \) compiler 5. Make sure to adhere to a "structured program" design and include appropriate program documentation. 6. Name the source file myShell.cpp