1 01/29/86  on
 2 
 3 Syntax as a command:
 4    on conditions handler_com_line {-control_args} subject_com_line
 5 
 6 
 7 Syntax as an active function:
 8    [on conditions handler_com_line {-control_args} subject_com_line]
 9 
10 
11 Function: establishes a handler for a specified set of conditions,
12 executes an embedded command line with this handler in effect, and then
13 reverts the handler.  The handler is another embedded command line to
14 be executed if the condition is signaled.
15 
16 
17 Arguments:
18 conditions
19    is a list of condition names separated by commas to be trapped by
20    the command.
21 handler_com_line
22    is the command line to be executed when one of the conditions
23    contained in the list of condition names is raised.  If
24    handler_com_line contains spaces or other command language
25    characters, enclose it in quotes.  If no command is to be executed
26    when a condition is raised, give handler_com_line as "".
27 subject_com_line
28    is the command line to be executed under the control of on; it
29    consists of the remaining arguments.  Quote it if it contains
30    parentheses, brackets, quotes, or semicolons.
31 
32 
33 Control arguments:
34 -brief, -bf
35    suppresses the comment printed when a condition occurs.
36 -cl
37    establishes a new command level after the execution of
38    handler_com_line.  You cannot use it in the active function.  The
39    state of subject_com_line is preserved.  If you issue the start
40    command, the same action is taken as would have been had you not
41    specified -cl.
42 -exclude STR, -ex STR
43    prevents on from trapping the conditions given in STR.  If you list
44    more than one condition, separate condition names by commas.  This
45    control argument is useful when handling the any_other condition.
46 
47 
48 -long, -lg
49    prints a detailed message describing the condition raised if one is
50    available.  This message is the same as the one printed by the
51    reprint_error command.
52 -restart, -rt
53    continues execution of the subject_com_line after execution of
54    handler_com_line or, if you also selected -cl, after execution of
55    start.  It is incompatible with -retry_command_line.
56 -retry_command_line, -rcl
57    aborts and executes over again subject_com_line after executing
58    handler_com_line.
59 
60 
61 Notes: The default action after executing handler_com_line is to abort
62 the execution of subject_com_line.
63 
64 If a condition is raised and trapped by on while executing the
65 handler_com_line, it is considered a recursive signal and the entire
66 invocation is aborted.
67 
68 See the Programmer's Reference Manual for a list of standard system
69 conditions.
70 
71 
72 Notes on active function: The active function returns "true" if any of
73 the specified conditions are signaled during the execution of
74 subject_com_line, "false" otherwise.