Question: Write a shell in C, similar to well-known shells such as bash. The shell will have an interactive input prompt, be able to parse command

Write a shell in C, similar to well-known shells such as bash. The shell will have an interactive input prompt, be able to parse command line input, expand parameters, and execute non-built-in commands. It will also have built-in commands such as exit and cd and support redirection operators, background processes, and custom behavior for signals. The program will run in an infinite loop until the exit command is executed, printing informative messages on errors. The prompt message will be based on the PS1 parameter, which is expanded before each new command line. The input will be split into words, delimited by IFS characters, and expanded in each word. The program will handle background processes by checking for any un-waited-for processes before printing the prompt message and printing informative messages for child processes. The program will read a line of input from stdin and handle any interruptions from signals.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!