|
|
Backquoted expressions may be coded as the value of a descriptor. They are evaluated at the time the descriptor is evaluated. When a backquoted expression produces output, it is considered part of the descriptor. This output must not produce an illegal value on the descriptor line. For instance, if the variable MYVAR is set to hello, then
action=`echo $MYVAR`open menu Mymenuwill be equivalent to
action=helloopen menu Mymenu
This produces an illegal descriptor value since helloopen is not a known FMLI command, and descriptors of type command must evaluate to a known FMLI command. As a result, the terminal will beep.
In addition to using backquoted expressions on descriptor lines, you can code them as ``stand-alone'' lines anywhere in menu, form, or text frame definition files. A stand-alone backquoted expression is one that starts a line, and it is evaluated when the frame definition file is opened, reread, or updated; before any descriptors are evaluated. Thus, if a stand-alone backquoted expression produces output to the message line, the output will appear before the frame being parsed is posted.
It is important to note that information can be passed to or from UNIX system executables and FMLI built-in commands using backquoted expressions. For example a menu item with the following definition of the action descriptor
action=`date | message` noppasses the output of the UNIX system date command to the FMLI built-in utility message, which displays it on the message line.
Using this feature of the Form and Menu Language, you can generate the entire contents of a frame dynamically at run time. For an example of a menu generated this way, see the regex(1fmli) manual page and ``Creating a dynamic menu''.
Several statements, utilizing FMLI built-in utilities or UNIX system executables, may appear inside a single backquoted expression, separated by one of the following operators: