Assignment 1, due Feb. 10

Part of the homework for 22C:112, Spring 2009
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Background: The C source file http://homepage.cs.uiowa.edu/~dwjones/opsys/shell.txt Contains a working command shell that should work under most Unix systems. Unfortunately, its slate of built-in commands is rather poor.

The exit built-in command causes the shell to exit, but as currently implemented, it ignores its parameters, if any. It really ought to accept a single optional argument.

The cd built-in command changes the current working directory, as documented by the man cd shell command.

The cd command uses the chdir() system call to change the current working directory. You may want to use the man 2 chdir shell command to get more documentation on this system call. You may also want to use the man 3 exit shell command to get information about the exit() routine in the C standard library.

Assignment: Fix the exit and add the cd built-in commands so they operate reasonably. Your code should conform to the C style guidelines for the class, and you should submit your source file using ICON.

Grading will focus on style as much as function, so working code will not earn more than half credit unless it is clear and readable, and clean code will earn some credit even if not functional.