## redirect

#### OS/161 Reference Manual

### Name

redirect - test I/O redirection

### Synopsis

`/testbin/redirect`

### Description

`redirect` does a simple test of I/O redirection like a Unix shell might do. It first creates an input test file, then invokes cat to copy it, with standard input and standard output suitably redirected. Then it checks that the copy happened correctly, and removes the test files.

The specifications of Unix system calls are such that this program should take no extra work to support once basic tests show that the pieces are working.

### Requirements

`redirect` uses the following system calls:

- open
- dup2
- read
- write
- close
- remove
- fork
- execv
- waitpid
- _exit

`redirect` should work once you have implemented the basic system calls, including fork, exec, and wait.

Note that until you implement remove (which is typically not part of the basic system calls assignment), and in any case on emufs, the test files will not get removed. This is not important, just untidy.