Handling CTRL-D in project 1
There has been some confusion over how to handle CTRL-D in interactive mode. In general, you should try to rely on the string input functions (e.g., fgets()) to do most of the work. However, here are some cases you should handle. In the example below, “$” is the prompt, and
Case 1:
$ command
$
You should execute the command and then exit the shell
Case 2:
$ command
The
Case 3:
$ command
You should execute command and then exit the shell
- Mike