From dfdaf53ac2bfb69502fa00e887ccf3d6d9f78929 Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Mon, 12 Feb 2018 08:05:32 -0600 Subject: [PATCH] Better exit definition, and clarification around no prompt in batch mode. --- processes-shell/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/processes-shell/README.md b/processes-shell/README.md index 9148138..a5a3d67 100644 --- a/processes-shell/README.md +++ b/processes-shell/README.md @@ -56,6 +56,9 @@ run the shell with a batch file named `batch.txt`: prompt> ./wish batch.txt ``` +One difference between batch and interactive modes: in interactive mode, a +prompt is printed (`wish> `). In batch mode, no prompt should be printed. + You should structure your shell such that it creates a process for each new command (the exception are *built-in commands*, discussed below). Your basic shell should be able to parse a command and run the program corresponding to @@ -214,7 +217,10 @@ message whenever you encounter an error of any type: The error message should be printed to stderr (standard error), as shown above. -After *any* error, your shell should immediately exit by calling `exit(1)`. +After ~~*any*~~ most errors, your shell simply *continue processing* after +printing the one and only error message. However, if the shell is invoked with +more than one file, or if the shell is passed a bad batch file, it should exit +by calling `exit(1)`. There is a difference between errors that your shell catches and those that the program catches. Your shell should catch all the syntax errors specified