Software Distributor Administration Guide HP-UX 11i v1, 11i v2, and 11i v3 (5900-2561, March 2013)

Any messages generated by the script will follow. If the script returns a value other than 0
(SUCCESS), then a concluding message such as the following, is written:
ERROR: The "unconfigure" script for "PRODUCT.FILESET"
failed (exit code "1"). The script location was
"/var/adm/sw/products/PRODUCT/FILESET/unconfigure".
* This script had errors but the execution of this
product will still proceed. Check the above output
from the script for further details.
WARNING: The "unconfigure" script for
"PRODUCT.FILESET" failed (exit code "2"). The script location was
"/var/adm/sw/products/PRODUCT/FILESET/unconfigure"
* This script had warnings but the execution of this
product will still proceed. Check the above output
from the script for further details.
The messages written by a control script must conform to the following format conventions
whenever possible.
1. Never emit blank lines.
2. All output lines must have one of these forms:
ERROR: text
WARNING: text
NOTE: text
<blank> text
In each case, the keyword, if there is one, must begin in column 1, and the text must
begin in column 10 (indented nine blanks).
3. Choose the keyword (ERROR, WARNING, NOTE, or blank) as follows:
ERROR: Cannot proceed, may need corrective action.
WARNING: Can proceed, but something went wrong and may need action.
NOTE: Can proceed, but something happened that is out of the ordinary or worth
special attention. (Not just a status message.)
<blank> Generic progress and status messages (keep them to a necessary minimum).
Do not start a line with an asterisk (*) character. This is reserved for operational messages
printed by the agent so you can easily distinguish them from other messages.
4. If the message text requires more than a single 72-character line, break it into several
72-character lines. Indent all lines after the first. For example:
NOTE: To install your new graphics package, you must turn on the lights
in the next room.Please turn them off when you leave.
5. Do not use tab characters in any messages.
Scripts execute other commands which may unexpectedly fail and emit output not in the above
format. Wherever you suspect a failure is possible or likely (and it is reasonable to do so)
redirect the standard output or error of the executed command to /dev/null or to a temporary
file. Then emit a proper-format message based on the return code or on output from the
command. For example:
/bin/grep bletch /etc/bagel 2c&>/dev/null
if[$?=1]
then
11.7 Control Script Input and Output 223