Question Write a C program, call it miniBash, that goes into an Infinite loop waiting for user's commands. Once a command is entered, your program should execute each command, using fork(), exec(), etc. Note: your miniBash should also recognize special characters like & (for background execution) and >, < (for redirection). Your program should execute any

F4QESW The Asker · Computer Science

Write a C program, call it miniBash, that goes into an Infinite loop waiting for user's commands. Once a command is entered, your program should execute each command, using fork(), exec(), etc.

Note: your miniBash should also recognize special characters like & (for background execution) and >, < (for redirection). Your program should execute any command that can be entered on Bash.

Important: you are NOT required to process any commands with piping in this assignment. miniBash> ls -1 |grep abc Examples of input

• miniBash> ps -e

• miniBash> cat sample.txt

• miniBash> ls -1 home/username/documents

• miniBash> ls -1>sample.txt 

miniBash> hello &

//Read about the “&” symbol in Linux and running a process in the background

More
Community Answer
EI8G59

&#12304;General guidance&#12305;The answer provided below has been developed in a clear step by step manner.Step1/1Solution::-The C program hat will act as a shell command line interpreter for the Linux kernel.#include&lt;stdio.h&gt;#include&lt;string.h&gt;#include&lt;stdlib.h&gt;#include&lt;unistd.h&gt;#include&lt;sys/types.h&gt;#include&lt;sys/wait.h&gt;#include&lt;readline/readline.h&gt;#include&lt;readline/history.h&gt;#define MAXCOM 1000 // max number of letters to be supported#define MAXLIST 100 // max number of commands to be supported// Clearing the shell using escape sequences#define clear() printf("\033[H\033[J")// Greeting shell during startupvoid&#160;init_shell(){clear();printf("\n\n\n\n******************""********* ... See the full answer