03/06/84 exec_com, ec Syntax: ec path {optional_args} Syntax as an active function: [ec ec_path {optional_args}] Function: executes a sequence of command lines contained in a segment. Arguments: path is the pathname of the segment containing commands to be executed and control statements to be interpreted; the ec suffix is optional. optional_args are character strings to be substituted for &i in the exec_com segment. List of character substitutions: &i (i is a positive integer) is replaced by the corresponding optional argument. &0 is replaced by the expanded, suffixed path. &qi, &ri are replaced after quoting or requoting the ith argument as does the do command (see the do command info file). &fi is replaced by the ith through last arguments separated by spaces. &n is replaced by the number of optional arguments of the exec_com. &f&n is replaced by the last argument to exec_com. &f0 is defined to be the same as &f1, so that &f&n is replaced by nothing when &n is zero. These can be combined-- &qfi &rfi &q&n &r&n &qf&n &rf&n &ec_name is replaced by the entryname portion of path without the ec suffix. &ec_dir is replaced by the pathname of the directory containing the exec_com segment. This can be used to simulate the referencing_dir search rule. &is_active_function, &is_af is replaced by the string "true" if exec_com was invoked as an active function, "false" otherwise. &is_absin is replaced by "true" if the exec_com segment is being executed as an absentee job, via enter_abs_request; "false" if it is executed by the exec_com command. &is_attached is replaced by "true" if user_input is attached via &attach, "false" otherwise. List of control statements: &label NAME identifies location by NAME. &goto NAME transfers control to &label NAME. &attach attaches user_input to the exec_com segment. &detach detaches user_input (restores its former attachment). &print STRING prints STRING on user_output as the format_line command would. Valid constructs (n and m are integers): ^/ or ^n/ are replaced by 1 or n newline characters. ^| or ^n| are replaced by 1 or n new page characters. ^- or ^n- are replaced by 1 or n tab characters. ^x or ^nx are replaced by 1 or n spaces. ^^ or ^n^ are replaced by 1 or n ^ (caret) characters. ^nt or ^n.mt position to column n, skipping at least 1 or m spaces. ^n(...^) repeat the delimited string n times. &quit returns exec_com to caller (e.g., command level). &return STRING returns exec_com to caller, but if invoked as an active function, STRING is the result, and if invoked as a command, STRING is printed (not by ioa_) with a trailing newline. &if IF_EXPRESSION executes &then clause if IF_EXPRESSION evaluates to "true" executes optional &else clause if IF_EXPRESSION evaluates to "false" otherwise error. IF_EXPRESSION can be an active function invocation, (e.g., &if [exists file &r1] &then &else &quit) or it can be a character string with parameter substitution. The &if statements can be nested to any depth. &then THEN_CLAUSE can include a command line, input line, null statement, and any control statement except &then and &label. &else ELSE_CLAUSE can include a command line, input line, null statement, and any control statement except &then and &label. This statement is optional, but, if present, it must immediately follow the preceding &then or &else clause on the same or next line. &version 1 if present, it must be the first line of the exec_com segment. This statement serves to identify the version of the exec_com language that should be used to interpret the exec_com segment. List of tracing statements: &command_line STATE controls the trace printing of lines that exec_com executes as commands. &control_line STATE controls the trace printing of lines that contain exec_com control statements. &comment_line STATE controls the trace printing of exec_com comment lines (lines that begin with an ampersand but not a recognized keyword). &input_line STATE controls the trace printing of lines that exec_com supplies as input to commands in &attach mode. &ready STATE when on, causes the ready procedure to print a message when it is called by the exec_com command. &ready_proc STATE when on, causes the exec_com command to call the ready procedure after executing each line it reads from the exec_com segment. STATE can be "on" or "off"; "true" and "false", respectively, are synonyms. For tracing control statements, STATE can also be the keyword "stream" followed by an optional I/O stream name. If the name is ommited, the default (user_output) is assumed. This has no effect on the on/off state of the tracing mode. Notes on tracing defaults: The default for &control_line, &comment_line, and &ready is "off". The default for &command_line, &input_line, and &ready_proc is "on" when exec_com is invoked as a command, "off" when invoked as an active function. Notes: Keywords are only recognized at the beginnings of lines except for &then, &else, and their clauses. Lines beginning with unimplemented keywords are treated as comments; however, lines beginning with AMPERSAND SPACE should be used for comments to allow for the implementation of new keywords. Unimplemented keywords (anything beginning with ampersand) occurring elsewhere are left unexpanded. &0 is not the same as &ec_dir>&ec_name.ec. &0 is derived from the path argument to the exec_com command; it can contain links. &ec_dir is the pathname of the directory that contains the exec_com segment, as derived from the storage system when &ec_dir is expanded. &ec_dir is not necessarily replaced by the same character string each time it is expanded; however, it is always replaced by a correct pathname even if some directory in it is renamed. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved