The shell is the primary means for user interaction with a Unix system. The shell is a
Fantastic news! We've Found the answer you've been seeking!
Question:
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
Related Book For
Principles Of Information Security
ISBN: 9780357506431
7th Edition
Authors: Michael E. Whitman, Herbert J. Mattord
Posted Date: