8.3 Invoking Menu

The syntax for the menu command is:

c:\> menu [-bkmps] [-f firstmenu] menufile [args...]

If menufile is specified as -, the menu description is read from standard input. If the -p flag is specified and the menufile is not found, menu will additionally look for the menufile in the C/Base administrative directory, usually \cbase\lib\cbase\menufile, see cbasedir (C-3).

The -b flag allows the operator to enter and execute any shell command from within the menu by entering an exclamation point followed by the command to execute.

If menufile contains more than one menu description, -f firstmenu specifies the name of the first menu to display. The default is to display the first menu description in the file.

The -k flag lets the operator exit from a menu by pressing the INTERRUPT key; otherwise the operator may only exit the menu by selecting a menu choice.

The -m flag enables the built-in menu commands within menu. Built-in menu commands are disabled by default. The -m flag is ignored if the menufile explicitly enables or disables built-in menu commands with the BUILT_IN_COMMANDS= keyword in the menufile statement within a menufile.

The -s flag specifies that the menufile is to be run as a script. A script contains only menufile commands. No menu descriptions are displayed nor are menu descriptions described in the menufile. After running the commands, menu exits.

Any additional args specified are ignored by menu, but they may be examined by commands executed from within menu. Refer to Table 8-17, section 8.6.8. Args are only used with the built-in menu commands are enabled.