Quit Command


quit [n]


The quit command terminates menu. N is the numeric exit status returned by menu. If n is not specified, menu returns an exit status of 0.

The quit command is recognized only if it is the last command in a group of commands. When a choice is selected, menu passes all the commands that precede the quit command to the shell (or menu command processor if built-in menu commands are enabled) to be executed. If the shell returns an exit status of zero, the quit command is executed.

Menu requires that every menu file must contain at least one menu or quit command. Otherwise, it may not be possible to exit from the menu.


quit (halts menu with an exit status of 0)

quit 2 (halts menu with an exit status of 2)