Question: No spam answers, please! Help with a programming assignment that requires the knowledge of Bash and C++ Here is an image of instructions, and a

No spam answers, please!

Help with a programming assignment that requires the knowledge of Bash and C++

Here is an image of instructions, and a skeleton code provided below:

No spam answers, please! Help with a programming assignment that requires the

Skeleton Code:

Note that the comments in the code are also a type of quideline.

[Code]

#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include

// Put any global variables here

/* User Definable Custom Prompt: * * Allows users to define custom prompts using a simple command to change the string. * The following set of macros will be replaced as follows: * * - DIR: Current directory * - WHO: User's name * - DATE: Current date * - TIME: Current time */ void update_prompt() { }

int main(int argc, char** argv) { /* Parse command line arguments */

/* Initialize prompt to default (current directory followed by a colon */

/* Vector to maintain background processes */

/* Tokenize input command */

// The tokenizer may make empty tokens, eliminate them

// Account for special commands

// Check to see if the process is to run in the background or foreground

/* Remove quotes from beginning and end of tokens */

/* Replace the string \" with the character '\"' */

/* Detect command pipes */

/* Set up communication pipes */

/* Detect Redirection */

/* Execute commands in order */

return 0; }

[/EndCode]

For this assignment, you are to design a simple shell which implements a subset of the functionality of the Bourne Again Shell (Bash). The requirements for your shell are as follows l. Continually prompt for textual user input on a command line. 2. Parse user input according the the provided grammar (see Table 1 below) 3. When a user enters a well formed command, execute it in the same way as a shell 4. You must use the commands fork and exec to accomplish this. You may NOT use the C System command. 5. Allow users to pipe the standard output from one command to the input of another an arbitrary number of times. 6. Support input redirection from a file and output redirection to a file. 7. Allow users to specify whether the process will run in the background or foreground using an '&'. (Commands to run in the foreground do not have an '&' and commands that run in the background do) 8. (Bonus) Allow users to specify a custom prompt which supports printing the current directory, username, current date, and current time valid string unix command PIPE unix command II unix command REDIRECTION filename II unix command AMP II unix command I special command command name any valid executable/interpreted filename AMP 3& ARG string ARGS ARG ARGS ARG DIRECTORY absolute path llrelative path PIPE REDIRECTION Il

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!