The documentation is compiled out of commented sections of a recovery script or menu title.
A documentation is structured into several sections similar to Unix man pages. To place text into a documentation section, each line has to be preceded by a section tag consisting of a capital letter and a colon.
To write text for the DESCRIPTION section, the recovery script looks like this:
: # # D: This is an example that is displayed as # D: justified text in the DESCRIPTION section # D: of the documentation when displayed # D: with the 'doc' contributed command. # :
It is not necessary that all your documentation is done at the beginning of a recovery script. Suppose your script conducts several steps; it might make sense that you enter the documentation near the single steps to ensure an update if the code changes in the future.
A second line prints the logical menu path where you are in, i.e. which menus you have to enter to go to the menu or menupoint. This section is dynamically generated.
Example:
# # D: The database to be refreshed has been # D: stopped and removed by the Storage Mgmt group. # D: # D: If the "oracle server" or "oracle instance" is # D: "up", contact the Storage Mgmt group. #
Example:
# # R: YES #
# # O: PERMISSION OWNER GROUP DIRECTORY # O: drwxr-x--- oracle dba /ora01/oradata/DWHPROD # O: drwxr-x--- oracle dba /ora02/oradata/DWHPROD # O: drwxr-x--- oracle dba /ora03/oradata/DWHPROD #
Example 2 (using .SS SubSection Title to create two output sub-sections):
# # O: .SS If host acme007 is up: # O: 22:26:53 up 3:51, 1 user, load average: 0.09, 0.15, 0.22 # # O: .SS If host acme007 is not up: # O: ssh-exec-ERROR: remote system 'acme007' is not up, aborting. #
To efficiently get data from a log file, use the outex(1) command from within the vi session, using:
# # ~ ~ ~ :. !outex 2009-09-22_13.10.22__list_db_files.log
Example:
# # L: The UID (User-ID) and UNAME (User-name) # L: cannot be changed in this tool. #
Example
# # N: Special character input is not # N: allowed (Control-Characters, Umlaut, etc.) #
Example:
# # F: /etc/passwd # F: /etc/nsswitch.conf # F: /var/spool/cron/atjobs/<at-job-file> #
It is not needed to indent the text as done in the example below for the [AWK] and [CHA] references. The text following a reference can be written as shown for [SSP], the output will be identical for all.
Example:
# # S: [AWK] The AWK Programming Language, October 1988, # S: Aho Alfred V., Weinberger Peter J., # S: Kernighan Brian W., ISBN 0-201-07981-X # S: [CHA] Clusters, For High Availability, # S: 2nd Edition 2001, Weygant Peter S., # S: HP-Part No: B3936-90047, ISBN 0-13-089355-2 # S: [SSP] Shellscript Programmierung, Sun Service, # S: Revision C21 February 1994, Sun Microsystems Inc., # S: Sun Part No: 8xx-xxxx-xx #
Example:
# # T: ~7 minutes #
If using the scripttitle(3) command, the duration text given here is displayed as expected duration in braces.
Example:
# # D: Why go fishing in Canada? # D: - vast area of wild nature where # D: the big fish can be caught. # D: - peaceful lakes and streams invite to # D: relax and recover from daily hassles. #
Example:
# # D: Why go fishing in Canada? # D: - vast area of non touched nature where # D: the big fish can be caught. # D: - peaceful lakes and streams invite to # D: relax and recover from daily problems. # D: /- # D: Of course there are other places to # D: experience similar landscape as ... #
unformatted output of text.
Example:
# # D: To efficiently rename many menu points, use: # D: <pre> # D: lsmv > a; vi a; sh ./a; rm a; \ # D: scriptheadersync -execute # D: </pre> # D: This loads the 'mv' commands into 'vi' and #
Example:
# # D: Beside orcas you can see humpback whales and # D: if you are lucky you will catch a view of a # D: gray whale. # D: # D: It might be the case that you are more # D: interested in bears, those fellows can be # D: seen near ... #
Example:
# # D: Hint: # D: <br> # D: The 'Be Bear Aware Campaign' is a national, # D: non-profit conservation organization ... #
This formatting cannot be used in sections: F: FILES, O: OUTPUT-EXAMPLE, F: FILES and S: SEE ALSO.
Example:
# # D: Bears are not mean or malicous - <b>they # D: are wild</b> - and all wild animals need # D: their space. #
This formatting cannot be used in sections: F: FILES, O: OUTPUT-EXAMPLE, F: FILES and S: SEE ALSO.
Example:
# # D: Blackbears, grizzly bears, polar bears, # D: oh <i>wonderful</i> bears! #
Basically the <u>text</u> is identical to the <i>text</i> specification, but to show that the underlining is important to your documenting, this control can be used.
The <u>text</u> can be used to "document" that a text is underlined.
This formatting cannot be used in sections: F: FILES, O: OUTPUT-EXAMPLE, F: FILES and S: SEE ALSO.
Example:
# # D: To see more information about bears, # D: visit the 'Be Bear Aware Campaign': # D: # D: <u>https://bebearaware.org</u> #
However, it is possible to define additional sections and documentation tags.
To do so you have to list it using the &: tag in each recovery script or menu title where you need special sections.
A section definition has the format:
# &: specification [{ specification }]
# # &: e:EMERGENCY%CONTACTS w:WORKAROUNDS # #
The sections can then be used:
# # e: +41 12 345 67 89, 7x24 hour operations # # w: If you cannot log on to the host dcdbsi20 any more # w: try to connect via the lan console dcdbsi20cons from # w: another server in the farm. #
The new defined sections EMERGENCY CONTACTS and WORKAROUNDS will be listed after the predefined sections. The output is justified.
Be aware that the first line of a menu title file contains the title of the menu which is displayed when you invoke the menu command in edrc. The following lines can contain the documentation tags.
Create/edit/remove the menu title file using the title command in edrc.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.