



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: Unix Software Development; Subject: Computer Science; University: Western Washington University; Term: Fall 2009;
Typology: Assignments
1 / 6
This page cannot be seen from the preview
Don't miss anything!




Due: Wednesday, November 4 2009 For this assignment, we will continue work on the mini-shell. Start with the code base you have for the last assignment. (ASSIGNMENT-3 tagged sources.) This assignment’s work consists of the following steps:
msh filename arg1 arg2 arg3 arg4 arg
instead of
msh
To add argument processing for main’s arguments, do the following:
Note: Again, these are not command lines processed by msh, this is how msh is started. You will need to use mainargc and mainargv as passed into the main function of your msh program.
Argument 2 is b. Argument 3 is c. Argument 4 is d. Number of arguments is 4. Argument 1 is d. Argument 2 is e. Argument 3 is f. Argument 4 is. Number of arguments is 5. Argument 1 is c. Number of arguments is 7. Argument 1 is a.
Note: Good implementations of shift and unshift will not copy data in the mainargv variable or change the mainargv variable. Note: While the above script has the $n variables near the end of the line, they may appear anywhere in the line and there may more than one replacement needed.
start with a period.) The file names placed into the expanded string must be separated by a single space character between file names. You should not have leading or trailing spaces. Note: If the trailing characters include a slash (/), generate an error message and stop the processing of the current line. Also note: If no file names are matched, the pattern must be put in the ex- panded string. A final note: A double quote before a star should be treated as having a leading space. Finally, don’t use a regu- lar expression matching library to implement wildcard expansion. You are to use opendir(3) and friends.
These fields should be separated by a single space between the fields. Each file should be listed on a separate line. If there is no associated user name or group name, print the uid or gid in numerical form. (Hint: man strmode)