From bea75caaa9ce40c0d5b3b19ce643595ac397e74a Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Sun, 11 Feb 2018 16:52:24 -0600 Subject: [PATCH] exit gracefully upon EOF --- processes-shell/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/processes-shell/README.md b/processes-shell/README.md index 6f005fe..9148138 100644 --- a/processes-shell/README.md +++ b/processes-shell/README.md @@ -81,6 +81,9 @@ which the shell is given an input file of commands; in this case, the shell should not read user input (from `stdin`) but rather from this file to get the commands to execute. +In either mode, if you hit the end-of-file marker (EOF), you should call +`exit(0)` and exit gracefully. + To parse the input line into constituent pieces, you might want to use `strtok()` (or, if doing nested tokenization, use `strtok_r()`). Read the man page (carefully) for more details.