Software Distributor Administration Guide for HP-UX 11i
Using Control Scripts
Control Script Input and Output
Chapter 11 399
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
echo “ERROR: Cannot find bletch in /etc/bagel.” |&>2
fi
• Follow these conventions to ensure a control script’s messages have a
similar look and feel to the messages generated by the agent (and the
commands themselves).
— Use full sentences wherever possible. Avoid terseness.
— Start sentences and phrases with capital letter and end with
period.
— Put two blanks after period; one after colons, semicolons, and
commas.
— Use uppercase first letters of phrases after colons. (This helps
break up the message into digestible “bites” of information.)
— Surround product, fileset, directory, and file names, and other
variable-valued strings with quotes. For example:
echo "ERROR: Cannot open file \"$file\"." &>2
— Write in the present tense. Avoid “would”, “will”, and similar
verb tenses. Also avoid past tense except where necessary.
— Use “cannot” rather than “can’t”, “could not”, “couldn’t”, “unable
to”, “failed to”, and similar phrases.