1. Extend your shell with I/O redirection (mandatory for teams of 3 or 4)
When you start a command, there are always three default file streams open:
stdin (maps input from the keyboard by default), stdout (maps output to
the terminal by default), and stderr (maps error messages to the terminal
by default). These and other open files may be redirected, or mapped, to files
or devices that users specify.
Modify your shell so that it supports redirecting stdin and stdout to files.
You do not need to support redirection for your shell built-in commands (i.e.,
cd, exit, path, and myhistory). You do not need to support stderr
redirection or appending to files (e.g., cmd3 >> out.txt). You may assume
that there will always be spaces around the special characters < and >. Be
aware that the "< file" or "> file" are not passed as arguments to your
shell program.
Some redirection examples include:
$ cmd1 < in.txt
executes cmd1, using in.txt as the source of input, instead of the
keyboard.
$ cmd2 > out.txt
executes cmd2 and places the output to file out.txt.
You will need to understand Linux file descriptors and use the open(),
close(), and dup()/dup2() family of system calls. This portion of the
project should only require implementing single input redirection and single
output redirection (not both redirection or working with pipes).