Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Written in C: This assignment is to write a shell program which will implement 7 commands: 1) the echo command, 2) the PS1 prompt command,

Written in C:

This assignment is to write a shell program which will implement 7 commands: 1) the echo command, 2) the PS1 prompt command, 3) the cat command, 4) the cp file command, 5) the rm file command 6) the mkdir dir command and 7) the rmdir dir command.

Program Requirements 1.

1. Create an application which will implement a command loop and accept the commands defined by the following requirements. These will be builtin commands.

2. Implement the echo command to display its argument to the console. It will assume a carriage return. If the option -n is entered the carriage return will not be issued.

3. Implement the "PS1 command to change the display of the prompt. The initial prompt will be the $ .

4. Implement the cat command to display the contents of a file.

5. Implement the cp command to copy the contents of a file. 6.

The student will implement the rm command to delete the file.

7. Implement the mkdir command to create a directory.

8. Implement the rmdir command to delete the directory. 9. The student will implement the exit command to exit mysh. 10. If an incorrect command is entered a Usage message will be displayed and the prompt will be redisplayed.

11. The name of the program will be mysh, an abbreviation of my shell. The program must be written in C and named mysh.c.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions