Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction The shell is the primary means for user interaction with a Unix system. The shell is a program like any other program and has

Introduction The shell is the primary means for user interaction with a Unix system. The shell is a program like any other program and has the capabilities built into the logic to implement the functionality users require. Assignment Description 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 directory command and 7) the rmdir directory command. Program Requirements 1. The student will create an application which will implement a command loop and accept the commands defined by the following requirements. These will be builtin commands. 2. The student will 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. The student will implement the PS1 command to change the display of the prompt. The initial prompt will be the $ . 4. The student will implement the cat command to display the contents of a file. 5. The student will implement the cp command to copy the contents of a file. 6. The student will implement the rm command to delete the file. 7. The student will implement the mkdir command to create a directory. 8. The student will 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 student is required to use the -ansi option to gcc for this assignment. 12. The student is required to put their name at the top of the .c source file. 13. The name of the program will be mysh, an abbreviation of my shell. The program must be written in C and named mysh.c. 14. The student will tar the program. The tar command for the C program is: $ tar czf studentlastname_mysh.tgz mysh.c

Note: I am new to Unix and C programming. I have a general idea of how to compile this in Ubuntu, but I am struggling with the code itself. Help would be really appreciated!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions

Question

What is cost plus pricing ?

Answered: 1 week ago

Question

1. What are the types of wastes that reach water bodies ?

Answered: 1 week ago

Question

Which type of soil has more ability to absorb water?

Answered: 1 week ago