Figure 4

 1: #
 2: # t.mnu (compiles into t.mnc):
 3: # Top level menu for CMENU test system. To test this menu,
 4: # start in a test directory /u/myname/menu, and
 5: # put the command script "test.sh" into the this directory.
 6: # Then create a subdirectory named "/u/myname/menu/test"
 7: # and put the object file for menu t2 (t2.mnc) in it.
 8: #
 9:
10: menu:
11:     title "The MAIN Menu"      # menu title appears at top
12:     escape                     # allow shell escapes
13:     spacing 2                  # double space the entries
14:
15:     item:
16:         "Run test.sh"
17:         help 'next item is "zot"'
18:         action "test.sh"       # after the "speed" program runs,
19:         nextitem zot           # item "zot" (below) is highlighted
20:
21:     item:
22:         "Run External Menu t2"
23:         path "test"            # run menu "t2", found in
24:         emenu "t2"             # subdirectory "test".
25:
26:     item:
27:         "run a Unix shell"
28:         action "exec sh"       # most efficient with "exec"
29:
30:     item:
31:         "run shell, no exec."  # creates an extra process.
32:         action sh              # (note: quotes not really needed)
33:
34:     item zot:
35:         'ITEM "Zot": list the directory (in reverse chron. order)'
36:         help 'this is a help line for #2, "ZOT"'
37:         action "ls -t"
38:         prompt                 # prompt user before continuing
39:
40:     item
41:         text "Do a long directly listing (no prompt)"
42:         help "the next item should ALSO be zot"
43:         action "l"
44:         nextitem zot
45:
46:     item
47:         text "GO TO MENU BAR"  # invoke a locally defined menu
48:         lmenu bar
49:
50:     item
51:         text "filler"          # clone this entry several times
52:         action "ls"            # to see automatic multiple columns
53:
54:     item
55:         text "filler"          # clone this entry several times
56:         action "ls"            # to see automatic multiple columns
57: endmenu
58:
59:
60: menu bar:
61:   title "This is local menu BAR. shell escpaes won't work."
62:   noescape
63:   path "/usr/bin"
64:
65:     item
66:         text "here is the first item of menu BAR"
67:         action "ls"; prompt    # semi OK as separator
68:
69:     item
70:         text "here is the next item of menu BAR"
71:         action "ls" prompt     # so is a space
72:
73:     item
74:         text "here is the LAST item of the menu BAR (with help)"
75:         help "this is help for the LAST item of menu BAR"
76:         action "ls"
77: endmenu