03/20/81 - Auditing and editing I/O: Auditing allows one to keep a record or log of activity on a particular I/O switch. Also, it allows editing of input. The simplest use of auditing is: ! attach_audit This will set up auditing of input and output and enable audit editing. An audit file will be placed in the user's home directory with a two component entry name. The first component of the name is the date and the second component is the suffix ".audit". Audit requests: The audit requests are always recognized when auditing is on. The three character request sequence is the trigger character followed by the desired request followed by a new line. The default trigger character is an exclamation mark ("!"). The requests are: !. print "audit" and which of input and output is being audited. !? print a brief description of available audit requests. !e enter the audit editor. !E enter the audit editor, with the input line processed as edit requests. !a abbrev expand the input line. See the MPM documentation on abbrev for more information. !r replay the input line. That is, display the input line without a new line. Further input up to the next new line is appended to the redisplayed input. This is the input line which is passed through the audit_ I/O module. !t instructs the audit_ module not to log the input line, i.e. to make it transparent. !n no operation. The input line to which this is appended is simply passed through the audit_ module. !d delete the line. It prevents the input line from ever being seen by the system. Editor requests: The audit editor requests are presented in two categories, familiar requests and special requests. The editor syntax is basically that of qedx. Any number of requests may be on the same line and spaces are ignored. Addressing, where appropriate, is done the same as in qedx with two notable exceptions. First, the "." is a request for self-identification rather than an indicator for the current address. Second, addresses are in terms of entries in the audit file rather than lines in a buffer. If the default search tag is in use, as is the case unless specifically defeated, the absolute entry number refers to the number of entries with the default search tag from the beginning of the file. Similarly, a relative entry address refers to the number of entries with the default search tag before or after the current address. Familiar requests: [[ADR1,]ADR2]p print print the addressed entries. s/REGEXP/STRING/ substitute replace occurrences of REGEXP in the edit buffer with STRING. ADR location locate the addressed entry. If ADR is not followed by a request the edit buffer is printed. An ADR can contain an absolute entry reference at its beginning, relative addresses in any portion, and regular expressions in any portion. An absolute address is either a number or the dollar-sign (to indicate the last entry in the audit file. ..STRING execute pass STRING to command processor and return to the audit editor. = print current entry number print the current entry number. This value is dependent on the current default search tag. If the default search tag changes, the current entry may also change. q quit quit from the editor without doing anything (i.e., returning any characters). Special requests: expand expand abbrev abbrev expand the edit buffer. off audit off don't audit input and output in the editor. on audit on audit the editor. l last returned line address the last line returned by the audit editor. r[STRING] return line return the rest of the request line, if non-null. Otherwise, return the edit buffer (without trigger sequence). n return new-line returns a new-line character. type print type print the audit entry type of the current position. exec execute pass the edit buffer to the command processor and return to the audit editor. d/STRING/ default search tag set the default search tag to STRING. If STRING is only one character, then only the first character of the tag is used to determine if an entry is seen (in counting entries and doing searches). If STRING is two characters, the match is done one both characters of the tag. Request syntax and processing: The square brackets in the request syntax above are to indicate the contained item is optional. The square brackets are not typed when entering the request. If execution of a request, in the audit editor, should fail for any reason, the processing of that request line is aborted, the user is informed of the failure, and a new request is prompted for. Note that this means the user is left in the editor when a problem is encountered executing a request line associated with a E audit request. The audit editor may be entered recursively, and each level of the editor has its own memory for the last returned line from its level. Examples: To set up with default audit file in homedir; attach_audit To set up with an audit file in the process_dir; attach_audit -pn [pd]>my_audit_file To set the audit file to be a circular file of 5 records; io modes user_i/o audit_file_size=5 To re-execute the last use of the pl1 command;