exit exit message "error message text" exit status <integer error code>
The commands exit and quit, as well as the END-OF-FILE character (usually Ctrl-D) terminate input from the current input stream: terminal session, pipe, or file input (pipe). If input streams are nested (inherited load scripts), then reading will continue in the parent stream. When the top level stream is closed, the program itself will exit.
The command exit gnuplot will immediately and unconditionally cause gnuplot to exit even if the input stream is multiply nested. In this case any open output files may not be completed cleanly. Example of use:
bind "ctrl-x" "unset output; exit gnuplot"
The command exit error "error message" simulates a program error. In interactive mode it prints the error message and returns to the command line, breaking out of all nested loops or calls. In non-interactive mode the program will exit.
When gnuplot exits to the controlling shell, the return value is not usually informative. This variant of the command allows you to return a specific value. This command is EXPERIMENTAL. Details may change; appearance in version 5.4 is not guaranteed.
exit status <value>
See help for batch/interactive for more details.