Go to the previous section.


When an error occurs, if ed's input is from a regular file or here document, then it exits, otherwise it prints a `?' and returns to command mode. An explanation of the last error can be printed with the `h' (help) command.

If the `u' (undo) command occurs in a global command list, then the command list is executed only once.

Attempting to quit ed or edit another file before writing a modified buffer results in an error. If the command is entered a second time, it succeeds, but any changes to the buffer are lost.

ed exits with 0 if no errors occurred; otherwise >0.

Go to the previous section.